diff options
| author | Douwe Maan <douwe@gitlab.com> | 2016-07-13 18:06:11 +0000 |
|---|---|---|
| committer | Douwe Maan <douwe@gitlab.com> | 2016-07-13 18:06:11 +0000 |
| commit | b8f67b4ddf6b4a56fc25565d66230fc6e78ba72d (patch) | |
| tree | 882af00a70d099a617c8f9acefb048351b32c9ee /lib/api | |
| parent | d2c9e8ab6e696f9b2dd3abcddd7cb526e8057a14 (diff) | |
| parent | 228073986bfb900ef324379639e1c5cce6b74fe6 (diff) | |
| download | gitlab-ce-b8f67b4ddf6b4a56fc25565d66230fc6e78ba72d.tar.gz | |
Merge branch 'dropdown-load-fix' into 'master'
Dropdown loading time preformance fix
## What does this MR do?
Optimizes the performance of the dropdown load time by just sending the required data to load the dropdown instead of the full object
This MR aims to fix #17474
See merge request !5113
Diffstat (limited to 'lib/api')
| -rw-r--r-- | lib/api/entities.rb | 1 | ||||
| -rw-r--r-- | lib/api/projects.rb | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 301dbb688a7..8e03c08f47b 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -54,6 +54,7 @@ module API class BasicProjectDetails < Grape::Entity expose :id + expose :http_url_to_repo, :web_url expose :name, :name_with_namespace expose :path, :path_with_namespace end diff --git a/lib/api/projects.rb b/lib/api/projects.rb index 0cc1edd65c8..6d2a6f3946c 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -25,7 +25,11 @@ module API @projects = current_user.authorized_projects @projects = filter_projects(@projects) @projects = paginate @projects - present @projects, with: Entities::ProjectWithAccess, user: current_user + if params[:simple] + present @projects, with: Entities::BasicProjectDetails, user: current_user + else + present @projects, with: Entities::ProjectWithAccess, user: current_user + end end # Get an owned projects list for authenticated user |
