diff --git a/LearningHub.Nhs.WebUI/Controllers/AccountController.cs b/LearningHub.Nhs.WebUI/Controllers/AccountController.cs index 1281d1d18..068e81cdf 100644 --- a/LearningHub.Nhs.WebUI/Controllers/AccountController.cs +++ b/LearningHub.Nhs.WebUI/Controllers/AccountController.cs @@ -648,15 +648,16 @@ public async Task CreateAccountCurrentRole(AccountCreationViewMod public async Task CreateAccountProfessionalRegNumber(AccountCreationViewModel accountCreationViewModel) { var roleCheck = int.TryParse(accountCreationViewModel.CurrentRole, out int roleId); + var accountCreation = await this.multiPageFormService.GetMultiPageFormData(MultiPageFormDataFeature.AddRegistrationPrompt, this.TempData); + if (string.IsNullOrWhiteSpace(accountCreationViewModel.CurrentRole) || !roleCheck) { this.ModelState.AddModelError("CurrentRole", CommonValidationErrorMessages.RoleRequired); var jobroles = await this.jobRoleService.GetPagedFilteredAsync(accountCreationViewModel.FilterText, 1, UserRegistrationContentPageSize); - return this.View("CreateAccountCurrentRole", new AccountCreationListViewModel { FilterText = accountCreationViewModel.FilterText, RoleList = jobroles.Item2, AccountCreationPaging = new AccountCreationPagingModel { TotalItems = jobroles.Item1, PageSize = UserRegistrationContentPageSize, HasItems = jobroles.Item1 > 0, CurrentPage = 1 }, ReturnToConfirmation = accountCreationViewModel.ReturnToConfirmation }); + return this.View("CreateAccountCurrentRole", new AccountCreationListViewModel { FilterText = accountCreationViewModel.FilterText, CountryId = accountCreation.CountryId, RoleList = jobroles.Item2, AccountCreationPaging = new AccountCreationPagingModel { TotalItems = jobroles.Item1, PageSize = UserRegistrationContentPageSize, HasItems = jobroles.Item1 > 0, CurrentPage = 1 }, ReturnToConfirmation = accountCreationViewModel.ReturnToConfirmation }); } var jobrole = await this.jobRoleService.GetByIdAsync(roleId); - var accountCreation = await this.multiPageFormService.GetMultiPageFormData(MultiPageFormDataFeature.AddRegistrationPrompt, this.TempData); accountCreation.CurrentRole = jobrole.Id.ToString(); accountCreation.CurrentRoleName = jobrole.Name; accountCreation.MedicalCouncilId = jobrole.MedicalCouncilId; diff --git a/LearningHub.Nhs.WebUI/Views/Account/CreateAccountCurrentRole.cshtml b/LearningHub.Nhs.WebUI/Views/Account/CreateAccountCurrentRole.cshtml index 1281e8120..f772e88bf 100644 --- a/LearningHub.Nhs.WebUI/Views/Account/CreateAccountCurrentRole.cshtml +++ b/LearningHub.Nhs.WebUI/Views/Account/CreateAccountCurrentRole.cshtml @@ -22,7 +22,7 @@
@if (!returnToConfirmation) { - if (Model.CountryId == "1" || errorHasOccurred) + if (Model.CountryId == "1") //|| errorHasOccurred {