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.

28 lines
672 B

  1. # frozen_string_literal: true
  2. class Settings::NotificationsController < Settings::BaseController
  3. def show; end
  4. def update
  5. user_settings.update(user_settings_params.to_h)
  6. if current_user.save
  7. redirect_to settings_notifications_path, notice: I18n.t('generic.changes_saved_msg')
  8. else
  9. render :show
  10. end
  11. end
  12. private
  13. def user_settings
  14. UserSettingsDecorator.new(current_user)
  15. end
  16. def user_settings_params
  17. params.require(:user).permit(
  18. notification_emails: %i(follow follow_request reblog favourite mention digest report),
  19. interactions: %i(must_be_follower must_be_following must_be_following_dm)
  20. )
  21. end
  22. end