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
731 B

  1. # frozen_string_literal: true
  2. class Api::V1::Admin::AccountActionsController < Api::BaseController
  3. before_action -> { doorkeeper_authorize! :'admin:write', :'admin:write:accounts' }
  4. before_action :require_staff!
  5. before_action :set_account
  6. def create
  7. account_action = Admin::AccountAction.new(resource_params)
  8. account_action.target_account = @account
  9. account_action.current_account = current_account
  10. account_action.save!
  11. render_empty
  12. end
  13. private
  14. def set_account
  15. @account = Account.find(params[:account_id])
  16. end
  17. def resource_params
  18. params.permit(
  19. :type,
  20. :report_id,
  21. :warning_preset_id,
  22. :text,
  23. :send_email_notification
  24. )
  25. end
  26. end