Commit e3daa73f authored by Bob Van Landuyt's avatar Bob Van Landuyt

Setup children in a a method and reuse for both calls

parent 9781ac55
......@@ -45,8 +45,7 @@ class GroupsController < Groups::ApplicationController
end
def show
@children = GroupChildrenFinder.new(current_user, parent_group: @group, params: params).execute
@children = @children.page(params[:page])
setup_children(@group)
respond_to do |format|
format.html
......@@ -69,8 +68,7 @@ class GroupsController < Groups::ApplicationController
render_404
end
@children = GroupChildrenFinder.new(current_user, parent_group: parent, params: params).execute
@children = @children.page(params[:page])
setup_children(parent)
respond_to do |format|
format.json do
......@@ -119,6 +117,11 @@ class GroupsController < Groups::ApplicationController
protected
def setup_children(parent)
@children = GroupChildrenFinder.new(current_user, parent_group: parent, params: params).execute
@children = @children.page(params[:page])
end
def setup_projects
set_non_archived_param
params[:sort] ||= 'latest_activity_desc'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment