public IActionResult AlterWaterDosing(int aquariumId, [FromBody] WaterDosing waterDosing) { try { _logger.LogInformation("POST /v1/Aquarium/{aquariumId}/Water/Dose called"); var aq = _aquariumService.GetAquariumById(aquariumId); var id = _accountService.GetCurrentUserId(); if (!_accountService.CanModify(id, aq)) { return(new UnauthorizedResult()); } waterDosing.AquariumId = aquariumId; waterDosing = _aquariumService.UpdateWaterDosing(waterDosing); return(new OkObjectResult(waterDosing)); } catch (Exception ex) { _logger.LogError($"POST /v1/Aquarium/{aquariumId}/Water/Dose endpoint caught exception: { ex.Message } Details: { ex.ToString() }"); return(NotFound()); } }
public WaterDosing UpdateWaterDosing(WaterDosing waterDosing) { return(_aquariumDao.UpdateWaterDosing(waterDosing)); }
public WaterDosing AddWaterDosing(WaterDosing waterDosing) { return(_aquariumDao.AddWaterDosing(waterDosing)); }