diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-09-13 17:16:30 +0200 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-10-04 22:49:41 +0200 |
commit | 3a4dc55f2924debcdbb37eb63d8ce57b1358df81 (patch) | |
tree | 614d82e8b26b5c2698c564d9e244a86c35d714fe /app/controllers/dashboard | |
parent | 39df53ff0aeac24d390eea52a1df6dfe103a4c14 (diff) | |
download | gitlab-ce-3a4dc55f2924debcdbb37eb63d8ce57b1358df81.tar.gz |
Reuse the groups tree for explore and dashboard.
Diffstat (limited to 'app/controllers/dashboard')
-rw-r--r-- | app/controllers/dashboard/groups_controller.rb | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/app/controllers/dashboard/groups_controller.rb b/app/controllers/dashboard/groups_controller.rb index 6488e0b6c09..025769f512a 100644 --- a/app/controllers/dashboard/groups_controller.rb +++ b/app/controllers/dashboard/groups_controller.rb @@ -1,20 +1,8 @@ class Dashboard::GroupsController < Dashboard::ApplicationController - def index - @groups = GroupsFinder.new(current_user, all_available: false).execute - # Only show root groups if no parent-id is given - @groups = @groups.where(parent_id: params[:parent_id]) - @groups = @groups.search(params[:filter]) if params[:filter].present? - @groups = @groups.includes(:route) - @groups = @groups.sort(@sort = params[:sort]) - @groups = @groups.page(params[:page]) + include GroupTree - respond_to do |format| - format.html - format.json do - serializer = GroupChildSerializer.new(current_user: current_user) - .with_pagination(request, response) - render json: serializer.represent(@groups) - end - end + def index + groups = GroupsFinder.new(current_user, all_available: false).execute + render_group_tree(groups) end end |