1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-05 16:24:21 +01:00
fab-manager/app/views/api/abuses/index.json.jbuilder

18 lines
524 B
Plaintext
Raw Normal View History

2019-05-09 18:27:19 +02:00
json.abuses do
json.array!(@abuses) do |abuse|
2019-05-21 11:49:50 +02:00
json.extract! abuse, :id, :signaled_id, :signaled_type, :first_name, :last_name, :email, :message, :created_at
case abuse.signaled_type
when 'Project'
json.signaled do
json.extract! abuse.signaled, :name, :slug, :published_at
json.author do
json.id abuse.signaled.author.id
json.full_name abuse.signaled.author&.user&.profile&.full_name
2019-05-21 11:49:50 +02:00
end
end
else
json.signaled abuse.signaled
end
2019-05-09 18:27:19 +02:00
end
end