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
5 changes: 3 additions & 2 deletions LearningHub.Nhs.WebUI/Controllers/AccountController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -648,15 +648,16 @@ public async Task<IActionResult> CreateAccountCurrentRole(AccountCreationViewMod
public async Task<IActionResult> CreateAccountProfessionalRegNumber(AccountCreationViewModel accountCreationViewModel)
{
var roleCheck = int.TryParse(accountCreationViewModel.CurrentRole, out int roleId);
var accountCreation = await this.multiPageFormService.GetMultiPageFormData<AccountCreationViewModel>(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<AccountCreationViewModel>(MultiPageFormDataFeature.AddRegistrationPrompt, this.TempData);
accountCreation.CurrentRole = jobrole.Id.ToString();
accountCreation.CurrentRoleName = jobrole.Name;
accountCreation.MedicalCouncilId = jobrole.MedicalCouncilId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<div class="nhsuk-grid-column-two-thirds @(returnToConfirmation ? "nhsuk-u-padding-top-7":string.Empty) nhsuk-u-padding-bottom-9">
@if (!returnToConfirmation)
{
if (Model.CountryId == "1" || errorHasOccurred)
if (Model.CountryId == "1") //|| errorHasOccurred
{
<vc:back-link asp-controller="Account" asp-action="CreateAccountRegionSelection" asp-all-route-data="@routeData" link-text="Back to: Select your region" />

Expand Down
Loading