summaryrefslogtreecommitdiff
path: root/lib/api/user_counts.rb
blob: 8df4b381bbfecce3a552eb887fc3ca2cca53ea16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true

module API
  class UserCounts < Grape::API
    resource :user_counts do
      desc 'Return the user specific counts' do
        detail 'Open MR Count'
      end
      get do
        unauthorized! unless current_user

        {
          merge_requests: current_user.assigned_open_merge_requests_count
        }
      end
    end
  end
end