From faeea0baefa9f86f52de5b29a50c8bcff9ba247a Mon Sep 17 00:00:00 2001 From: Anju Jose Date: Tue, 27 Feb 2024 09:33:50 +0000 Subject: [PATCH 1/2] DefectFix-TD-3744 --- .../Controllers/AccountController.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/LearningHub.Nhs.WebUI/Controllers/AccountController.cs b/LearningHub.Nhs.WebUI/Controllers/AccountController.cs index c999f6b1f..70dff1a74 100644 --- a/LearningHub.Nhs.WebUI/Controllers/AccountController.cs +++ b/LearningHub.Nhs.WebUI/Controllers/AccountController.cs @@ -1,5 +1,6 @@ namespace LearningHub.Nhs.WebUI.Controllers { + using System; using System.Collections.Generic; using System.Linq; using System.Net; @@ -1232,7 +1233,22 @@ private async Task GetAccountConfirmationDetails(Ac var employer = await this.locationService.GetByIdAsync(int.TryParse(accountCreationViewModel.LocationId, out int primaryEmploymentId) ? primaryEmploymentId : 0); var region = await this.regionService.GetAllAsync(); var specialty = await this.specialtyService.GetSpecialtiesAsync(); - var role = await this.jobRoleService.GetPagedFilteredAsync(accountCreationViewModel.CurrentRoleName, accountCreationViewModel.CurrentPageIndex, UserRegistrationContentPageSize); + var role = new Tuple>(0, null); + if (!string.IsNullOrEmpty(accountCreationViewModel.CurrentRoleName) && accountCreationViewModel.CurrentRoleName.Contains('/')) + { + string jobrole = accountCreationViewModel.CurrentRoleName.Replace("/", " "); + role = await this.jobRoleService.GetPagedFilteredAsync(jobrole, accountCreationViewModel.CurrentPageIndex, UserRegistrationContentPageSize); + } + else + { + role = await this.jobRoleService.GetPagedFilteredAsync(accountCreationViewModel.CurrentRoleName, accountCreationViewModel.CurrentPageIndex, UserRegistrationContentPageSize); + } + + if (role.Item1 > 0) + { + accountCreationViewModel.CurrentRoleName = role.Item2.FirstOrDefault(x => x.Id == int.Parse(accountCreationViewModel.CurrentRole)).NameWithStaffGroup; + } + if (role.Item1 > 0) { accountCreationViewModel.CurrentRoleName = role.Item2.FirstOrDefault(x => x.Id == int.Parse(accountCreationViewModel.CurrentRole)).NameWithStaffGroup; From 187650b8d19bafaddf61b9e2739e7e62bedb1eae Mon Sep 17 00:00:00 2001 From: Anju Jose Date: Tue, 27 Feb 2024 09:41:18 +0000 Subject: [PATCH 2/2] DefectFix-TD-3744 --- LearningHub.Nhs.WebUI/Controllers/AccountController.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/LearningHub.Nhs.WebUI/Controllers/AccountController.cs b/LearningHub.Nhs.WebUI/Controllers/AccountController.cs index 70dff1a74..2bd4bb997 100644 --- a/LearningHub.Nhs.WebUI/Controllers/AccountController.cs +++ b/LearningHub.Nhs.WebUI/Controllers/AccountController.cs @@ -1249,11 +1249,6 @@ private async Task GetAccountConfirmationDetails(Ac accountCreationViewModel.CurrentRoleName = role.Item2.FirstOrDefault(x => x.Id == int.Parse(accountCreationViewModel.CurrentRole)).NameWithStaffGroup; } - if (role.Item1 > 0) - { - accountCreationViewModel.CurrentRoleName = role.Item2.FirstOrDefault(x => x.Id == int.Parse(accountCreationViewModel.CurrentRole)).NameWithStaffGroup; - } - var grade = await this.gradeService.GetGradesForJobRoleAsync(int.TryParse(accountCreationViewModel.CurrentRole, out int roleId) ? roleId : 0); var confirmationPayload = new AccountCreationConfirmation {