Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/serializers/admin/abuse_report_entity.rb')
-rw-r--r--app/serializers/admin/abuse_report_entity.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/app/serializers/admin/abuse_report_entity.rb b/app/serializers/admin/abuse_report_entity.rb
new file mode 100644
index 00000000000..58637445e81
--- /dev/null
+++ b/app/serializers/admin/abuse_report_entity.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+module Admin
+ class AbuseReportEntity < Grape::Entity
+ include RequestAwareEntity
+
+ expose :category
+ expose :created_at
+ expose :updated_at
+
+ expose :reported_user do |report|
+ UserEntity.represent(report.user, only: [:name])
+ end
+
+ expose :reporter do |report|
+ UserEntity.represent(report.reporter, only: [:name])
+ end
+
+ expose :report_path do |report|
+ admin_abuse_report_path(report)
+ end
+ end
+end