2023-06-13 22:38:07 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class Settings::VerificationsController < Settings::BaseController
|
|
|
|
before_action :set_account
|
2024-09-10 08:00:40 -04:00
|
|
|
before_action :set_verified_links
|
2023-06-13 22:38:07 -04:00
|
|
|
|
2024-09-10 08:00:40 -04:00
|
|
|
def show; end
|
|
|
|
|
|
|
|
def update
|
|
|
|
if UpdateAccountService.new.call(@account, account_params)
|
|
|
|
ActivityPub::UpdateDistributionWorker.perform_async(@account.id)
|
|
|
|
redirect_to settings_verification_path, notice: I18n.t('generic.changes_saved_msg')
|
|
|
|
else
|
|
|
|
render :show
|
|
|
|
end
|
2023-06-13 22:38:07 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
2024-09-10 08:00:40 -04:00
|
|
|
def account_params
|
|
|
|
params.require(:account).permit(:attribution_domains_as_text)
|
|
|
|
end
|
|
|
|
|
2023-06-13 22:38:07 -04:00
|
|
|
def set_account
|
|
|
|
@account = current_account
|
|
|
|
end
|
2024-09-10 08:00:40 -04:00
|
|
|
|
|
|
|
def set_verified_links
|
|
|
|
@verified_links = @account.fields.select(&:verified?)
|
|
|
|
end
|
2023-06-13 22:38:07 -04:00
|
|
|
end
|