fix admin tab query

This commit is contained in:
2458773093 2019-07-16 15:58:29 +03:00
parent 2558251cc5
commit b9641b41e7
1 changed files with 1 additions and 1 deletions

View File

@ -16,7 +16,7 @@ class Api::V1::GroupsController < Api::BaseController
when 'member'
@groups = Group.joins(:group_accounts).where(is_archived: false, group_accounts: { account: current_account }).all
when 'admin'
@groups = Group.joins(:group_accounts).where(is_archived: false, group_accounts: { account: current_account, write_permissions: true }).all
@groups = Group.joins(:group_accounts).where(is_archived: false, group_accounts: { account: current_account, role: :admin }).all
end
render json: @groups, each_serializer: REST::GroupSerializer