public async Task <IActionResult> Options([FromRoute] string employerAccountId, CreateVacancyOptionsEditModel model) { bool shouldShowCloningChangingMessage = string.IsNullOrWhiteSpace(Request.Cookies[CookieNames.HasSeenCloningMethodIsChangingMessage]); if (!ModelState.IsValid) { var vm = await _orchestrator.GetCreateOptionsViewModelAsync(employerAccountId, shouldShowCloningChangingMessage); return(View(vm)); } if (model.VacancyId == Guid.Empty) { return(RedirectToRoute(RouteNames.CreateVacancy_Get)); } var newVacancyId = await _orchestrator.CloneVacancy(employerAccountId, model.VacancyId.Value, User.ToVacancyUser()); return(RedirectToRoute(RouteNames.Vacancy_Preview_Get, new { VacancyId = newVacancyId })); }
public async Task <IActionResult> Options([FromRoute] string employerAccountId, CreateVacancyOptionsEditModel model) { if (!ModelState.IsValid) { var vm = await _orchestrator.GetCreateOptionsViewModelAsync(employerAccountId); return(View(vm)); } if (model.VacancyId == Guid.Empty) { return(RedirectToRoute(RouteNames.CreateVacancy_Get)); } var newVacancyId = await _orchestrator.CloneVacancy(employerAccountId, model.VacancyId.Value, User.ToVacancyUser()); return(RedirectToRoute(RouteNames.Vacancy_Preview_Get, new { VacancyId = newVacancyId })); }