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

Setup children in a a method and reuse for both calls

parent 4e6f0d79e6be
......@@ -45,8 +45,7 @@ def create
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 @@ def children
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 @@ def destroy
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