Merged PR 2244: added condition to fix log in journey in welsh if no account in crm

added condition to fix log in journey in welsh if no account in crm

Related work items: #22081, #22303
This commit is contained in:
Robert Bond
2026-04-13 15:54:51 +00:00
parent 0de9268255
commit 15c35d201e
4 changed files with 30 additions and 14 deletions
+6 -5
View File
@@ -37,11 +37,12 @@ const appendParamsAndPathToNewUrl = (fromUrl, toUrl) => {
return toUrlObj.toString();
};
const resolveRequestLocale = (req) =>
req?.query?.locale ||
req?.body?.locale ||
req?.cookies?.pedw_locale ||
"en";
const resolveRequestLocale = (req) => {
const locale =
req?.body?.locale || req?.query?.locale || req?.cookies?.pedw_locale;
return locale === "cy" ? "cy" : "en";
};
const resolveCrmLocale = async (email) => {
if (!email) return null;