diff options
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/groups.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/api/groups.rb b/lib/api/groups.rb index 9d0b55c35c7..c7f41aba854 100644 --- a/lib/api/groups.rb +++ b/lib/api/groups.rb @@ -46,7 +46,9 @@ module API groups = GroupsFinder.new(current_user, find_params).execute groups = groups.search(params[:search]) if params[:search].present? groups = groups.where.not(id: params[:skip_groups]) if params[:skip_groups].present? - groups = groups.reorder(params[:order_by] => params[:sort]) + order_options = { params[:order_by] => params[:sort] } + order_options["id"] ||= "asc" + groups = groups.reorder(order_options) groups end |