public async Task <IActionResult> Index(Guid requestId, bool edit) { var supportRequest = await _mediator.Send(new GetTempSupportRequest(requestId)); var vm = new YourDetailsViewModel(supportRequest, requestId, edit); return(View("~/Views/RequestSupport/YourDetails.cshtml", vm)); }
public async Task <IActionResult> Index(Guid requestId, YourDetailsViewModel viewModel) { if (!ModelState.IsValid) { return(RedirectToAction("Index", "YourDetails", new { requestId })); } var supportRequest = await _mediator.Send(new GetTempSupportRequest(requestId)); viewModel.UpdateTempSupportRequest(supportRequest); await _mediator.Send(new SaveTempSupportRequest()); if (viewModel.Edit == true) { return(RedirectToAction("Index", "CheckYourDetails", new { requestId = requestId })); } return(RedirectToAction("Index", "OrganisationType", new { requestId = requestId })); }