public async Task <ActionResult <Bank> > DeleteBank(int id) { try { //string authHeader = Request.Headers["Authorization"]; //if (!Utils.SWDUtils.isAdmin(authHeader)) //{ // return Unauthorized(new { Message = "Access Denied!" }); //} var bank = await _bankService.GeBankByIDAsync(id); if (bank == null) { return(NotFound()); } else { if (await _bankService.DeleteBankAsync(bank)) { return(NoContent()); } else { return(BadRequest()); } } } catch (Exception e) { return(StatusCode(StatusCodes.Status500InternalServerError, new { Message = e.Message })); } }