From 5b20df0a9276bc1250dc8b307adb161b24d9c255 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Fri, 25 Jan 2019 18:34:45 +0100 Subject: [PATCH] Add projects/:id/starrers API endpoint for users who starred a repository --- lib/api/projects.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/api/projects.rb b/lib/api/projects.rb index 0923d31f5ff..ed9f5a9039e 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -358,6 +358,18 @@ module API end end + desc 'List users who starred this project' do + success Entities::UserBasic + end + params do + use :collection_params + end + get ':id/starrers' do + users = DeclarativePolicy.subject_scope { user_project.starrers } + + present users, with: Entities::UserBasic + end + desc 'Get languages in project repository' get ':id/languages' do ::Projects::RepositoryLanguagesService