summaryrefslogtreecommitdiff
path: root/lib/api/entities/notification_setting.rb
blob: cdff4f2f5c5dd082cf4729167f67fbb74bafe6d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# frozen_string_literal: true

module API
  module Entities
    class NotificationSetting < Grape::Entity
      expose :level
      expose :events, if: ->(notification_setting, _) { notification_setting.custom? } do
        ::NotificationSetting.email_events.each do |event|
          expose event
        end
      end
    end
  end
end