Updates to groups sorting
• Updates to groups sorting
This commit is contained in:
@@ -12,7 +12,8 @@ class Api::V1::GroupsController < Api::BaseController
|
||||
def index
|
||||
case current_tab
|
||||
when 'featured'
|
||||
@groups = Group.where(is_featured: true, is_archived: false).limit(100).all
|
||||
@groupIds = FetchGroupsService.new.call("featured")
|
||||
@groups = Group.where(id: @groupIds).limit(150).all
|
||||
when 'new'
|
||||
if !current_user
|
||||
render json: { error: 'This method requires an authenticated user' }, status: 422
|
||||
|
||||
@@ -62,7 +62,7 @@ class Api::V1::Timelines::GroupCollectionController < Api::BaseController
|
||||
|
||||
@groupIds = []
|
||||
if @collection_type == 'featured'
|
||||
@groupIds = Group.where(is_featured: true, is_archived: false).limit(100).all.pluck(:id)
|
||||
@groupIds = FetchGroupsService.new.call("featured")
|
||||
elsif @collection_type == 'member' && !current_user.nil?
|
||||
@groupIds = current_user.account.groups.pluck(:id)
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user