diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2016-03-29 18:59:03 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2016-03-30 10:44:20 +0200 |
commit | 26631f9981a826ebe4aeba726e9be2b813d2c5c5 (patch) | |
tree | 0e0cdbabeb3f0fd8b9cfdd2abf5db106d885cd06 /app/controllers/groups | |
parent | 729fe42bff474535c9eebb0b73974a79756372b8 (diff) | |
download | gitlab-ce-26631f9981a826ebe4aeba726e9be2b813d2c5c5.tar.gz |
Change how notification settings in profile are rendered and updated
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/controllers/groups')
-rw-r--r-- | app/controllers/groups/notification_settings_controller.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/controllers/groups/notification_settings_controller.rb b/app/controllers/groups/notification_settings_controller.rb new file mode 100644 index 00000000000..78e43c83aba --- /dev/null +++ b/app/controllers/groups/notification_settings_controller.rb @@ -0,0 +1,14 @@ +class Groups::NotificationSettingsController < Groups::ApplicationController + def update + notification_setting = group.notification_settings.where(user_id: current_user).find(params[:id]) + 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 |