class Cooperative::UsersController < Cooperative::BaseController def index params[:sort_by] = params[:sort_by].presence || 'created_on' params[:sort_direction] = params[:sort_direction].presence || 'desc' users = Admins::UserQuery.call(search_params) @users = paginate users.includes(user_extension: :school) end private def search_params params.permit(:name, :sort_by, :sort_direction) end end