public ActionResult DeleteConsumption(int id) { string loggedUser = User.FindFirstValue("userId"); if (loggedUser == null) { return(Unauthorized()); } try { consumptionService.DeleteConsumption(id); } catch (SkrillaApiException e) { if ("not_found".Equals(e.Code)) { return(NotFound()); } else { return(BadRequest(e.Message)); } } return(Accepted()); }
public ActionResult DeleteConsumption(Int32 id) { _consumptionService.DeleteConsumption(UserId, id); return(Ok()); }