mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 20:00:49 +08:00
fixed bot安装列表按安装者分组,增加用户信息
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user