Add privacy extra settings page

This commit is contained in:
KMY 2023-09-03 10:50:12 +09:00
parent 9641e0d2c6
commit 0e0e9e383b
8 changed files with 84 additions and 23 deletions

View file

@ -0,0 +1,27 @@
# frozen_string_literal: true
class Settings::PrivacyExtraController < Settings::BaseController
before_action :set_account
def show; end
def update
if UpdateAccountService.new.call(@account, account_params.except(:settings))
current_user.update!(settings_attributes: account_params[:settings])
ActivityPub::UpdateDistributionWorker.perform_async(@account.id)
redirect_to settings_privacy_extra_path, notice: I18n.t('generic.changes_saved_msg')
else
render :show
end
end
private
def account_params
params.require(:account).permit(settings: UserSettings.keys)
end
def set_account
@account = current_account
end
end