2022-06-27 16:50:20 -07:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class Settings::PrivacyController < ApplicationController
|
|
|
|
before_action :authenticate_user!
|
|
|
|
|
|
|
|
def edit; end
|
|
|
|
|
|
|
|
def update
|
2022-11-06 06:00:28 -08:00
|
|
|
user_attributes = params.require(:user).permit(:privacy_lock_inbox,
|
|
|
|
:privacy_allow_anonymous_questions,
|
2022-06-27 16:50:20 -07:00
|
|
|
:privacy_allow_public_timeline,
|
|
|
|
:privacy_allow_stranger_answers,
|
2022-11-13 05:26:03 -08:00
|
|
|
:privacy_show_in_search,
|
2022-11-16 13:32:40 -08:00
|
|
|
:privacy_require_user,
|
|
|
|
:privacy_noindex)
|
2022-06-27 16:50:20 -07:00
|
|
|
if current_user.update(user_attributes)
|
|
|
|
flash[:success] = t(".success")
|
|
|
|
else
|
|
|
|
flash[:error] = t(".error")
|
|
|
|
end
|
|
|
|
redirect_to settings_privacy_path
|
|
|
|
end
|
|
|
|
end
|