summaryrefslogtreecommitdiff
path: root/app/controllers/groups_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/groups_controller.rb')
-rw-r--r--app/controllers/groups_controller.rb17
1 files changed, 15 insertions, 2 deletions
diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb
index 994e736d66e..414170dc504 100644
--- a/app/controllers/groups_controller.rb
+++ b/app/controllers/groups_controller.rb
@@ -2,6 +2,7 @@ class GroupsController < Groups::ApplicationController
include IssuesAction
include MergeRequestsAction
include ParamsBackwardCompatibility
+ include GroupsTree
respond_to :html
@@ -73,8 +74,20 @@ class GroupsController < Groups::ApplicationController
def subgroups
return not_found unless Group.supports_nested_groups?
- @nested_groups = GroupsFinder.new(current_user, parent: group).execute
- @nested_groups = @nested_groups.search(params[:filter_groups]) if params[:filter_groups].present?
+ parent = group
+ parent = Group.find_by(id: params[:parent_id]) if params[:parent_id]
+
+ @nested_groups = find_groups(parent)
+
+ respond_to do |format|
+ format.html
+ format.json do
+ render json: GroupSerializer
+ .new(current_user: current_user)
+ .with_pagination(request, response)
+ .represent(@nested_groups)
+ end
+ end
end
def activity