Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/groups_controller.rb')
-rw-r--r--app/controllers/groups_controller.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb
index a714f2cc7b0..575d5476867 100644
--- a/app/controllers/groups_controller.rb
+++ b/app/controllers/groups_controller.rb
@@ -74,11 +74,11 @@ class GroupsController < Groups::ApplicationController
respond_to do |format|
format.json do
- render json: GroupChildSerializer
- .new(current_user: current_user)
- .with_pagination(request, response)
- .hierarchy_base(parent, open_hierarchy: filter[:filter].present)
- .represent(@children)
+ serializer = GroupChildSerializer
+ .new(current_user: current_user)
+ .with_pagination(request, response)
+ serializer.expand_hierarchy(parent) if params[:filter].present?
+ render json: serializer.represent(@children)
end
end
end