Commit 39df53ff authored by Bob Van Landuyt's avatar Bob Van Landuyt

Use the default sort set by the `Sortable` concern

parent 4c8942f9
class Dashboard::GroupsController < Dashboard::ApplicationController
def index
@sort = params[:sort] || 'id_desc'
@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)
@groups = @groups.sort(@sort = params[:sort])
@groups = @groups.page(params[:page])
respond_to do |format|
......
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