Skip to content

Commit

Permalink
Merge pull request #183 from companieshouse:feature/fix-company-numbe…
Browse files Browse the repository at this point in the history
…r-missing-after-lang-change

Fix companyNumber missing from URL after lang change
  • Loading branch information
hepsimo authored Dec 5, 2024
2 parents 4e645b3 + 5601fcd commit 0fd3b95
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/routers/handlers/stop-screen/stopScreenHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const setContent = async (req: Request, res: Response, stopType: STOP_TYPE, base
...baseViewData,
...getLocaleInfo(locales, lang),
templateName: stopType,
currentUrl: resolveUrlTemplate(stopScreenPrefixedUrl, stopType),
currentUrl: addSearchParams(getUrlWithStopType(stopScreenPrefixedUrl, stopType), { companyNumber, lang }),
backURL: addSearchParams(resolveUrlTemplate(PrefixedUrls.CONFIRM_COMPANY), { companyNumber }),
backLinkDataEvent: "company-type-back-link",
extraData: [companyName, resolveUrlTemplate(PrefixedUrls.COMPANY_NUMBER), env.CONTACT_US_LINK]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ describe("Stop screen handler", () => {
expect(viewData).toMatchObject(
{
...expectedViewData,
currentUrl: `/persons-with-significant-control-verification/stop/${stopType}?companyNumber=00006400&lang=en`,
backURL: `${PrefixedUrls.CONFIRM_COMPANY}?lang=en&companyNumber=00006400`,
extraData: [validCompanyProfile.companyName, `${PrefixedUrls.COMPANY_NUMBER}?lang=en`, env.CONTACT_US_LINK]
});
Expand Down

0 comments on commit 0fd3b95

Please sign in to comment.