summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2018-07-10 08:44:02 +0000
committerDouwe Maan <douwe@gitlab.com>2018-07-10 08:44:02 +0000
commite6b91cc357364b14a367b60b4c229d7e0785114d (patch)
tree3977a731dbefddf5e0e5ce9c876491639b196a0d /lib/api
parentc7dd9a6e049a6388cd40e7d8eb6678ac7dc1f015 (diff)
parente6f3452314c73875bbf9560a84706161c25c2831 (diff)
downloadgitlab-ce-e6b91cc357364b14a367b60b4c229d7e0785114d.tar.gz
Merge branch '42415-omit-projects-from-get-group-endpoint' into 'master'
Resolve "API: /groups/:name query very slow for groups with many projects" Closes #42415 See merge request gitlab-org/gitlab-ce!20494
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/groups.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/api/groups.rb b/lib/api/groups.rb
index f633dd88d06..797b04df059 100644
--- a/lib/api/groups.rb
+++ b/lib/api/groups.rb
@@ -150,12 +150,13 @@ module API
end
params do
use :with_custom_attributes
+ optional :with_projects, type: Boolean, default: true, desc: 'Omit project details'
end
get ":id" do
group = find_group!(params[:id])
options = {
- with: Entities::GroupDetail,
+ with: params[:with_projects] ? Entities::GroupDetail : Entities::Group,
current_user: current_user
}