summaryrefslogtreecommitdiff
path: root/app/controllers/groups/notification_settings_controller.rb
blob: de13b16ccf210cb65f1d9dbd10be9cc360cd880b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
class Groups::NotificationSettingsController < Groups::ApplicationController
  before_action :authenticate_user!

  def update
    notification_setting = current_user.notification_settings_for(group)
    saved = notification_setting.update_attributes(notification_setting_params)

    render json: { saved: saved }
  end

  private

  def notification_setting_params
    params.require(:notification_setting).permit(:level)
  end
end