public static async Task UpdateAccess(AccountUpdateAccessRequest request) { var account = ((Account)request.Account).GetManaged; var access = account.Access; var newAccess = request.Access; if (newAccess == access) { throw new Error400BadRequest <Account>("Tài khoản này đã được phân quyền là " + access); } await AccountDataAccess.UpdateAccess(account, newAccess); }
public async Task <IActionResult> UpdateAccess([FromBody] AccountUpdateAccessRequest request) { await AccountBusiness.UpdateAccess(request); return(NoContent()); }