public async Task <IActionResult> Title(VacancyRouteModel vrm, [FromQuery] string wizard = "true")
        {
            var vm = await _orchestrator.GetTitleViewModelAsync(vrm);

            vm.PageInfo.SetWizard(wizard);
            return(View(vm));
        }
Example #2
0
        //[HttpGet(ExistingVacancyTitleRoute, Name = RouteNames.Title_Post)]
        public async Task <IActionResult> Title(TitleEditModel model, [FromQuery] string employerAccountId, [FromQuery] bool wizard)
        {
            var ukprn    = User.GetUkprn();
            var response = await _orchestrator.PostTitleEditModelAsync(model, User.ToVacancyUser(), ukprn);

            if (!response.Success)
            {
                response.AddErrorsToModelState(ModelState);
            }

            if (!ModelState.IsValid)
            {
                var vm = await _orchestrator.GetTitleViewModelAsync(model, ukprn);

                vm.PageInfo.SetWizard(wizard);
                return(View(vm));
            }
            return(RedirectToRoute(RouteNames.ShortDescription_Get, new { vacancyId = response.Data }));
            // return wizard
            //     ? RedirectToRoute(RouteNames.ShortDescription_Get, new {vacancyId = response.Data})
            //     : RedirectToRoute(RouteNames.Vacancy_Preview_Get);
        }