diff options
author | Camil Staps <info@camilstaps.nl> | 2019-01-27 12:45:43 +0100 |
---|---|---|
committer | Camil Staps <info@camilstaps.nl> | 2019-08-07 20:49:14 +0200 |
commit | d03a4c9a07c1a1eebbb209514957abd3278bd602 (patch) | |
tree | d7f38234cfae694f6363db1999622c5fadba94c0 | |
parent | b74c5dbcd18a0d81189a9631504c0c9baf5c21be (diff) | |
download | gitlab-ce-d03a4c9a07c1a1eebbb209514957abd3278bd602.tar.gz |
Add users/:user_id/starred_projects API endpoint for projects starred by a user
-rw-r--r-- | lib/api/projects.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb index ed9f5a9039e..e24c5765de5 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -115,6 +115,22 @@ module API present_projects load_projects end + + desc 'Get a user\'s starred projects' do + success Entities::BasicProjectDetails + end + params do + requires :user_id, type: String, desc: 'The ID or username of the user' + use :collection_params + use :statistics_params + end + get ":user_id/starred_projects" do + user = find_user(params[:user_id]) + not_found!('User') unless user + + starred_projects = StarredProjectsFinder.new(user).execute(current_user) + present_projects starred_projects + end end resource :projects do |