public IActionResult MarkFishDeath([FromBody] FishDeath death) { try { //Access level var id = _accountService.GetCurrentUserId(); var fish = _fishService.GetFishById(death.FishId); var access = _accountService.CanModify(id, fish); if (!access) { return(Unauthorized()); } _logger.LogInformation($"POST /v1/Fish/Death called"); var d = _fishService.MarkDeseased(death); return(new OkObjectResult(d)); } catch (Exception ex) { _logger.LogError($"POST /v1/Fish/Death endpoint caught exception: { ex.Message } Details: { ex.ToString() }"); return(NotFound()); } }
public Fish MarkDeseased(FishDeath death) { return(_aquariumDao.MarkDeseased(death)); }