Skip to content

Commit 73db50a

Browse files
committed
TD-5130: Clearing country selection on new search
1 parent d5886de commit 73db50a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

LearningHub.Nhs.WebUI/Controllers/AccountController.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -474,18 +474,18 @@ public async Task<IActionResult> CreateAccountRegionSelection(AccountCreationVie
474474
accountCreation.CountryId = accountCreationViewModel.CountryId;
475475
}
476476

477-
if (accountCreation.CountryId == "1")
478-
{
479-
await this.multiPageFormService.SetMultiPageFormData(accountCreation, MultiPageFormDataFeature.AddRegistrationPrompt, this.TempData);
480-
var regionData = await this.regionService.GetAllPagedAsync(accountCreationViewModel.CurrentPageIndex, UserRegistrationContentPageSize);
481-
return this.View(new AccountCreationListViewModel { Region = regionData.Item2, AccountCreationPaging = new AccountCreationPagingModel { TotalItems = regionData.Item1, PageSize = UserRegistrationContentPageSize, HasItems = regionData.Item1 > 0, CurrentPage = accountCreationViewModel.CurrentPageIndex }, RegionId = accountCreation.RegionId, ReturnToConfirmation = accountCreationViewModel.ReturnToConfirmation });
482-
}
483-
else if (string.IsNullOrWhiteSpace(accountCreationViewModel.CountryId) || !countryCheck)
477+
if (string.IsNullOrWhiteSpace(accountCreationViewModel.CountryId) || !countryCheck)
484478
{
485479
this.ModelState.AddModelError("CountryId", CommonValidationErrorMessages.CountryRequired);
486480
var countries = await this.countryService.GetFilteredAsync(accountCreationViewModel.FilterText);
487481
return this.View("CreateAccountCountrySelection", new AccountCreationListViewModel { FilterText = accountCreationViewModel.FilterText, CountryList = countries.ToList(), ReturnToConfirmation = accountCreationViewModel.ReturnToConfirmation });
488482
}
483+
else if (accountCreation.CountryId == "1")
484+
{
485+
await this.multiPageFormService.SetMultiPageFormData(accountCreation, MultiPageFormDataFeature.AddRegistrationPrompt, this.TempData);
486+
var regionData = await this.regionService.GetAllPagedAsync(accountCreationViewModel.CurrentPageIndex, UserRegistrationContentPageSize);
487+
return this.View(new AccountCreationListViewModel { Region = regionData.Item2, AccountCreationPaging = new AccountCreationPagingModel { TotalItems = regionData.Item1, PageSize = UserRegistrationContentPageSize, HasItems = regionData.Item1 > 0, CurrentPage = accountCreationViewModel.CurrentPageIndex }, RegionId = accountCreation.RegionId, ReturnToConfirmation = accountCreationViewModel.ReturnToConfirmation });
488+
}
489489
else
490490
{
491491
accountCreation.CountryId = accountCreationViewModel.CountryId;

0 commit comments

Comments
 (0)