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/controllers/admin/abuse_reports_controller.rb')
-rw-r--r--app/controllers/admin/abuse_reports_controller.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/app/controllers/admin/abuse_reports_controller.rb b/app/controllers/admin/abuse_reports_controller.rb
index 329c4e4921a..b48d6f4f7c2 100644
--- a/app/controllers/admin/abuse_reports_controller.rb
+++ b/app/controllers/admin/abuse_reports_controller.rb
@@ -3,8 +3,11 @@
class Admin::AbuseReportsController < Admin::ApplicationController
feature_category :insider_threat
- before_action :set_status_param, only: :index, if: -> { Feature.enabled?(:abuse_reports_list) }
+ before_action :set_status_param, only: :index
before_action :find_abuse_report, only: [:show, :moderate_user, :update, :destroy]
+ before_action only: :show do
+ push_frontend_feature_flag(:abuse_report_labels)
+ end
def index
@abuse_reports = AbuseReportsFinder.new(params).execute
@@ -12,14 +15,11 @@ class Admin::AbuseReportsController < Admin::ApplicationController
def show; end
- # Kept for backwards compatibility.
- # TODO: See https://gitlab.com/gitlab-org/modelops/anti-abuse/team-tasks/-/issues/167?work_item_iid=443
- # In 16.4 remove or re-use this endpoint after frontend has migrated to using moderate_user endpoint
def update
- response = Admin::AbuseReports::ModerateUserService.new(@abuse_report, current_user, permitted_params).execute
+ response = Admin::AbuseReports::UpdateService.new(@abuse_report, current_user, permitted_params).execute
if response.success?
- render json: { message: response.message }
+ head :ok
else
render json: { message: response.message }, status: :unprocessable_entity
end
@@ -53,6 +53,6 @@ class Admin::AbuseReportsController < Admin::ApplicationController
end
def permitted_params
- params.permit(:user_action, :close, :reason, :comment)
+ params.permit(:user_action, :close, :reason, :comment, { label_ids: [] })
end
end