diff options
author | Camil Staps <info@camilstaps.nl> | 2019-01-25 20:34:45 +0300 |
---|---|---|
committer | Camil Staps <info@camilstaps.nl> | 2019-08-07 21:49:13 +0300 |
commit | 5b20df0a9276bc1250dc8b307adb161b24d9c255 (patch) | |
tree | 904b131ce663673d4212329168a354dce8de7c8e /lib | |
parent | ab498bd4f95b4f6bc9d2b235fadb7057f0ed13f8 (diff) |
Add projects/:id/starrers API endpoint for users who starred a repository
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/projects.rb | 12 |
1 files changed, 12 insertions, 0 deletions
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 |