group accounts improvements

This commit is contained in:
Rob Colbert
2019-08-08 14:40:44 +03:00
committed by 2458773093
parent 05037f60be
commit f7118a39df
7 changed files with 86 additions and 11 deletions

View File

@@ -26,7 +26,8 @@ class Api::V1::Groups::AccountsController < Api::BaseController
def update
authorize @group, :update_account?
GroupAccount.where(group: @group, account_id: current_account.id).update(group_account_params)
@account = @group.accounts.find(params[:account_id])
GroupAccount.where(group: @group, account: @account).update(group_account_params)
render_empty
end