1 # frozen_string_literal: true
4 class ReportedStatusesController
< BaseController
5 before_action
:set_report
8 authorize
:status, :update?
10 @form = Form
::StatusBatch.new(form_status_batch_params
.merge(current_account
: current_account
, action
: action_from_button
))
11 flash
[:alert] = I18n
.t('admin.statuses.failed_to_execute') unless @form.save
13 redirect_to
admin_report_path(@report)
19 params
.require(:status).permit(:sensitive)
22 def form_status_batch_params
23 params
.require(:form_status_batch).permit(status_ids
: [])
26 def action_from_button
29 elsif params
[:nsfw_off]
37 @report = Report
.find(params
[:report_id])