2023-05-27 22:25:52 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Admin
|
|
|
|
class AbuseReportEntity < Grape::Entity
|
2023-06-20 00:43:36 +05:30
|
|
|
include RequestAwareEntity
|
|
|
|
|
2023-05-27 22:25:52 +05:30
|
|
|
expose :category
|
2023-06-20 00:43:36 +05:30
|
|
|
expose :created_at
|
2023-05-27 22:25:52 +05:30
|
|
|
expose :updated_at
|
|
|
|
|
|
|
|
expose :reported_user do |report|
|
2023-07-09 08:55:56 +05:30
|
|
|
UserEntity.represent(report.user, only: [:name])
|
2023-05-27 22:25:52 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
expose :reporter do |report|
|
|
|
|
UserEntity.represent(report.reporter, only: [:name])
|
|
|
|
end
|
2023-06-20 00:43:36 +05:30
|
|
|
|
2023-07-09 08:55:56 +05:30
|
|
|
expose :report_path do |report|
|
2023-06-20 00:43:36 +05:30
|
|
|
admin_abuse_report_path(report)
|
|
|
|
end
|
2023-05-27 22:25:52 +05:30
|
|
|
end
|
|
|
|
end
|