summaryrefslogtreecommitdiff
path: root/lib/api/user_counts.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/user_counts.rb')
-rw-r--r--lib/api/user_counts.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/api/user_counts.rb b/lib/api/user_counts.rb
new file mode 100644
index 00000000000..8df4b381bbf
--- /dev/null
+++ b/lib/api/user_counts.rb
@@ -0,0 +1,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