Removed unread_count from group_accounts

This commit is contained in:
mgabdev
2020-05-09 23:57:38 -04:00
parent d16ef95681
commit f3c3a66e6b
11 changed files with 14 additions and 35 deletions

View File

@@ -14,7 +14,7 @@ class Api::V1::GroupsController < Api::BaseController
when 'featured'
@groups = Group.where(is_featured: true).limit(50).all
when 'member'
@groups = Group.joins(:group_accounts).where(is_archived: false, group_accounts: { account: current_account }).order('group_accounts.unread_count DESC, group_accounts.id DESC').all
@groups = Group.joins(:group_accounts).where(is_archived: false, group_accounts: { account: current_account }).order('group_accounts.id DESC').all
when 'admin'
@groups = Group.joins(:group_accounts).where(is_archived: false, group_accounts: { account: current_account, role: :admin }).all
end