public async Task <ActionResult <Bank> > PostBank([FromBody] Bank bank) { try { //string authHeader = Request.Headers["Authorization"]; //if (!Utils.SWDUtils.isAdmin(authHeader)) //{ // return Unauthorized(new { Message = "Access Denied!" }); //} if (await _bankService.AddBankAsync(bank)) { return(StatusCode(StatusCodes.Status201Created, bank)); } else { return(BadRequest()); } } catch (Exception e) { return(StatusCode(StatusCodes.Status500InternalServerError, new { Message = e.Message })); } }