debian-mirror-gitlab/lib/api/user_counts.rb

19 lines
380 B
Ruby
Raw Normal View History

2019-09-30 21:07:59 +05:30
# frozen_string_literal: true
module API
2020-07-28 23:09:34 +05:30
class UserCounts < Grape::API::Instance
2019-09-30 21:07:59 +05:30
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