diff --git a/LearningHub.Nhs.WebUI/Controllers/AccountController.cs b/LearningHub.Nhs.WebUI/Controllers/AccountController.cs index 979c1ac33..37813a17c 100644 --- a/LearningHub.Nhs.WebUI/Controllers/AccountController.cs +++ b/LearningHub.Nhs.WebUI/Controllers/AccountController.cs @@ -581,7 +581,18 @@ public async Task CreateAccountSearchRole(AccountCreationViewMode { var accountCreation = await this.multiPageFormService.GetMultiPageFormData(MultiPageFormDataFeature.AddRegistrationPrompt, this.TempData); - return this.View("CreateAccountSearchRole", new AccountCreationViewModel { CountryId = accountCreationViewModel.CountryId }); + var currentJobRole = int.TryParse(accountCreation.CurrentRole, out int currentRole); + if (currentJobRole && currentRole > 0) + { + var filterText = await this.jobRoleService.GetByIdAsync(currentRole); + accountCreationViewModel.FilterText = filterText.Name; + var jobrole = await this.jobRoleService.GetByIdAsync(currentRole); + return this.View("CreateAccountCurrentRole", new AccountCreationListViewModel { RoleList = new List { jobrole }, AccountCreationPaging = new AccountCreationPagingModel { TotalItems = 1, PageSize = UserRegistrationContentPageSize, HasItems = jobrole != null, CurrentPage = 1 }, CurrentRole = accountCreation.CurrentRole, CountryId = accountCreation.CountryId, RegionId = accountCreation.RegionId, FilterText = accountCreationViewModel.FilterText, ReturnToConfirmation = accountCreationViewModel.ReturnToConfirmation }); + } + else + { + return this.View("CreateAccountSearchRole", new AccountCreationViewModel { CountryId = accountCreationViewModel.CountryId }); + } } ///