Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions LearningHub.Nhs.WebUI/Controllers/AccountController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1265,17 +1265,7 @@ private async Task<AccountCreationConfirmation> 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 = new Tuple<int, List<JobRoleBasicViewModel>>(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);
}

var 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;
Expand Down
5 changes: 4 additions & 1 deletion LearningHub.Nhs.WebUI/Services/JobRoleService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using elfhHub.Nhs.Models.Common;
using LearningHub.Nhs.WebUI.Helpers;
using LearningHub.Nhs.WebUI.Interfaces;
using LearningHub.Nhs.WebUI.Models.Account;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using NuGet.Common;

/// <summary>
/// Defines the <see cref="JobRoleService" />.
Expand Down Expand Up @@ -101,7 +104,7 @@ public async Task<Tuple<int, List<JobRoleBasicViewModel>>> GetPagedFilteredAsync

var client = await this.userApiHttpClient.GetClientAsync();

var request = $"JobRole/GetPagedFilteredWithStaffGroup/{filter}/{page}/{pageSize}";
var request = $"JobRole/GetPagedFilteredWithStaffGroup/{Uri.EscapeDataString(filter.EncodeParameter())}/{page}/{pageSize}";
var response = await client.GetAsync(request).ConfigureAwait(false);

if (response.IsSuccessStatusCode)
Expand Down