group sidebar panel improvements

This commit is contained in:
2458773093
2019-07-20 02:45:14 +03:00
parent 61134fb645
commit 06e1c47ff4
4 changed files with 11 additions and 5 deletions

View File

@@ -14,7 +14,7 @@ class Api::V1::GroupsController < Api::BaseController
when 'featured'
@groups = Group.where(is_featured: true).limit(25).all
when 'member'
@groups = Group.joins(:group_accounts).where(is_archived: false, group_accounts: { account: current_account }).all
@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
when 'admin'
@groups = Group.joins(:group_accounts).where(is_archived: false, group_accounts: { account: current_account, role: :admin }).all
end