1
0

verifications_controller.rb 715 B

12345678910111213141516171819202122232425262728293031
  1. # frozen_string_literal: true
  2. class Settings::VerificationsController < Settings::BaseController
  3. before_action :set_account
  4. before_action :set_verified_links
  5. def show; end
  6. def update
  7. if UpdateAccountService.new.call(@account, account_params)
  8. ActivityPub::UpdateDistributionWorker.perform_async(@account.id)
  9. redirect_to settings_verification_path, notice: I18n.t('generic.changes_saved_msg')
  10. else
  11. render :show
  12. end
  13. end
  14. private
  15. def account_params
  16. params.require(:account).permit(:attribution_domains_as_text)
  17. end
  18. def set_account
  19. @account = current_account
  20. end
  21. def set_verified_links
  22. @verified_links = @account.fields.select(&:verified?)
  23. end
  24. end