diff options
| author | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-09-20 15:23:00 +0100 |
|---|---|---|
| committer | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-09-20 15:23:00 +0100 |
| commit | ff7b545c8e462b909af92a5bea58de779c3f438b (patch) | |
| tree | bdd6a8bc3c8527df2925288348c752eb87d1b9ea /lib/api/projects.rb | |
| parent | 55a7529621515eaeffa1424a281e639cf74be6cf (diff) | |
| parent | ff1deab6388dcb7f241205a1cd64eaddf1672753 (diff) | |
| download | gitlab-ce-ff7b545c8e462b909af92a5bea58de779c3f438b.tar.gz | |
Merge remote-tracking branch 'origin/master' into 18608-lock-issues
Diffstat (limited to 'lib/api/projects.rb')
| -rw-r--r-- | lib/api/projects.rb | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb index 7dc19788462..aab7a6c3f93 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -70,8 +70,11 @@ module API optional :import_url, type: String, desc: 'URL from which the project is imported' end - def present_projects(options = {}) - projects = ProjectsFinder.new(current_user: current_user, params: project_finder_params).execute + def load_projects + ProjectsFinder.new(current_user: current_user, params: project_finder_params).execute + end + + def present_projects(projects, options = {}) projects = reorder_projects(projects) projects = projects.with_statistics if params[:statistics] projects = projects.with_issues_enabled if params[:with_issues_enabled] @@ -111,7 +114,7 @@ module API params[:user] = user - present_projects + present_projects load_projects end end @@ -124,7 +127,7 @@ module API use :statistics_params end get do - present_projects + present_projects load_projects end desc 'Create new project' do @@ -229,6 +232,18 @@ module API end end + desc 'List forks of this project' do + success Entities::Project + end + params do + use :collection_params + end + get ':id/forks' do + forks = ForkProjectsFinder.new(user_project, params: project_finder_params, current_user: current_user).execute + + present_projects forks + end + desc 'Update an existing project' do success Entities::Project end |
