2019-09-30 21:07:59 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module API
|
2021-01-03 14:25:43 +05:30
|
|
|
class UserCounts < ::API::Base
|
2021-01-29 00:20:46 +05:30
|
|
|
feature_category :navigation
|
|
|
|
|
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
|
|
|
|
|
|
|
|
{
|
2021-03-08 18:12:59 +05:30
|
|
|
merge_requests: current_user.assigned_open_merge_requests_count, # @deprecated
|
|
|
|
assigned_merge_requests: current_user.assigned_open_merge_requests_count,
|
|
|
|
review_requested_merge_requests: current_user.review_requested_open_merge_requests_count
|
2019-09-30 21:07:59 +05:30
|
|
|
}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|