You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
635 B

  1. # frozen_string_literal: true
  2. module Admin
  3. class ReportedStatusesController < BaseController
  4. before_action :set_report
  5. before_action :set_status
  6. def update
  7. @status.update(status_params)
  8. redirect_to admin_report_path(@report)
  9. end
  10. def destroy
  11. RemovalWorker.perform_async(@status.id)
  12. redirect_to admin_report_path(@report)
  13. end
  14. private
  15. def status_params
  16. params.require(:status).permit(:sensitive)
  17. end
  18. def set_report
  19. @report = Report.find(params[:report_id])
  20. end
  21. def set_status
  22. @status = @report.statuses.find(params[:id])
  23. end
  24. end
  25. end