public async Task <ActionResult> Edit(PromoEditViewModel model) { if (ModelState.IsValid) { await PromoService.Update(model); return(RedirectToAction("Info", new { id = model.Id })); } return(View(model)); }
public async Task <ActionResult <PromoViewModel> > Update(UpdatePromoBody updatePromoBody) { try { Logger.LogInformation("Updating {Id}", updatePromoBody.Id); var result = await PromoService.Update(updatePromoBody); return(result); } catch (Exception e) { Logger.LogInformation("Update exception {Exception}", e.ToString()); return(BadRequest(e)); } }