Commit e07a1a5b authored by Mark Chao's avatar Mark Chao

Allow global event list containing all events

This way we can globally set group only ee events too.
Use nil to indicate global.
parent 8411d1cf
...@@ -50,7 +50,9 @@ module API ...@@ -50,7 +50,9 @@ module API
end end
end end
%w[group project].each do |source_type| [Group, Project].each do |source_class|
source_type = source_class.name.underscore
params do params do
requires :id, type: String, desc: "The #{source_type} ID" requires :id, type: String, desc: "The #{source_type} ID"
end end
...@@ -73,7 +75,7 @@ module API ...@@ -73,7 +75,7 @@ module API
end end
params do params do
optional :level, type: String, desc: "The #{source_type} notification level" optional :level, type: String, desc: "The #{source_type} notification level"
NotificationSetting.email_events(source_type.to_sym).each do |event| NotificationSetting.email_events(source_class).each do |event|
optional event, type: Boolean, desc: 'Enable/disable this notification' optional event, type: Boolean, desc: 'Enable/disable this notification'
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment