diff options
author | Rémy Coutable <remy@rymai.me> | 2017-03-15 19:09:24 +0100 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-03-16 18:00:24 +0100 |
commit | 63360adeae3ba5b302b711c73b6439956d274cde (patch) | |
tree | f547b1bc271a1b9c0f8df616cfb1fb5c2574c43a /lib/api/notification_settings.rb | |
parent | c9abdadd7a08f972d5a12472f9f5ac443e37a6ac (diff) | |
download | gitlab-ce-63360adeae3ba5b302b711c73b6439956d274cde.tar.gz |
Add `requirements: { id: %r{[^/]+} }` for all projects and groups namespaced API routes
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'lib/api/notification_settings.rb')
-rw-r--r-- | lib/api/notification_settings.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/api/notification_settings.rb b/lib/api/notification_settings.rb index c5e9b3ad69b..992ea5dc24d 100644 --- a/lib/api/notification_settings.rb +++ b/lib/api/notification_settings.rb @@ -48,14 +48,14 @@ module API end %w[group project].each do |source_type| - resource source_type.pluralize do + params do + requires :id, type: String, desc: "The #{source_type} ID" + end + resource source_type.pluralize, requirements: { id: %r{[^/]+} } do desc "Get #{source_type} level notification level settings, defaults to Global" do detail 'This feature was introduced in GitLab 8.12' success Entities::NotificationSetting end - params do - requires :id, type: String, desc: 'The group ID or project ID or project NAMESPACE/PROJECT_NAME' - end get ":id/notification_settings" do source = find_source(source_type, params[:id]) @@ -69,7 +69,6 @@ module API success Entities::NotificationSetting end params do - requires :id, type: String, desc: 'The group ID or project ID or project NAMESPACE/PROJECT_NAME' optional :level, type: String, desc: "The #{source_type} notification level" NotificationSetting::EMAIL_EVENTS.each do |event| optional event, type: Boolean, desc: 'Enable/disable this notification' |