From 8b74aa42176dabf77c3b4d02c80bcc47d9d70e8e Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Fri, 14 Apr 2017 05:10:28 -0400 Subject: Admin reports controller improvements (#1714) * Simplify admin/reports controller filtering for index * Rename parameter to resolved * Fix issue where reports view could not access filter_link_to * Add coverage for admin/reports controller * DRY up resolution of related reports for target account * Clean up admin/reports routes * Add Report#statuses method * DRY up current account action taken params * Rubocop styles --- app/controllers/admin/reported_statuses_controller.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 app/controllers/admin/reported_statuses_controller.rb (limited to 'app/controllers/admin/reported_statuses_controller.rb') diff --git a/app/controllers/admin/reported_statuses_controller.rb b/app/controllers/admin/reported_statuses_controller.rb new file mode 100644 index 000000000..7ae420dfe --- /dev/null +++ b/app/controllers/admin/reported_statuses_controller.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Admin + class ReportedStatusesController < BaseController + def destroy + status = Status.find params[:id] + + RemovalWorker.perform_async(status.id) + redirect_to admin_report_path(report) + end + + private + + def report + Report.find(params[:report_id]) + end + end +end -- cgit