闭社主体 forked from https://github.com/tootsuite/mastodon
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.

35 lines
697 B

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