This commit is contained in:
mgabdev
2020-12-15 19:31:30 -05:00
parent de0c977950
commit 75d52c841e
129 changed files with 2559 additions and 910 deletions

View File

@@ -46,7 +46,7 @@ class Api::V1::GroupsController < Api::BaseController
@groups = []
if !@groupCategory.nil?
@groups = Group.where(is_archived: false, group_categories: @groupCategory).all
@groups = Group.where(is_archived: false, group_categories: @groupCategory).order('member_count DESC').all
end
render json: @groups, each_serializer: REST::GroupSerializer
@@ -59,7 +59,7 @@ class Api::V1::GroupsController < Api::BaseController
@groups = []
if !params[:tag].empty?
@groups = Group.where(is_archived: false).where("array_to_string(tags, '||') ILIKE :tag", tag: "%#{params[:tag]}%").all
@groups = Group.where(is_archived: false).where("array_to_string(tags, '||') ILIKE :tag", tag: "%#{params[:tag]}%").order('member_count DESC').all
end
render json: @groups, each_serializer: REST::GroupSerializer