diff --git a/app/views/installations/index.json.jbuilder b/app/views/installations/index.json.jbuilder index 9235bd4f8..366bdeeca 100644 --- a/app/views/installations/index.json.jbuilder +++ b/app/views/installations/index.json.jbuilder @@ -2,7 +2,15 @@ json.status 0 json.message "success" json.data do json.array! @install_bots do |install_bot| - json.extract! install_bot, :id, :bot_id, :installer_id + json.extract! install_bot, :id, :bot_id, :installer_id, :create_time, :update_time json.bot_name install_bot&.bot&.name + json.account do + user = User.find_by(id: install_bot.installer_id) + if user.present? + json.partial! "api/v1/users/simple_user", locals: {user: user} + else + json.nil! + end + end end end \ No newline at end of file diff --git a/app/views/installations/show.json.jbuilder b/app/views/installations/show.json.jbuilder index 89db0107b..4ab91c1e4 100644 --- a/app/views/installations/show.json.jbuilder +++ b/app/views/installations/show.json.jbuilder @@ -1,5 +1,13 @@ json.partial! "commons/success" -json.extract! @install_bot, :id, :bot_id, :installer_id +json.extract! @install_bot, :id, :bot_id, :installer_id, :create_time, :update_time json.bot_name @install_bot&.bot&.name +json.account do + user = User.find_by(id: @install_bot.installer_id) + if user.present? + json.partial! "api/v1/users/simple_user", locals: { user: user } + else + json.nil! + end +end