Merged in hotfix/mystays-url (pull request #1644)
Revert mystays booking url * Revert mystays booking url Approved-by: Michael Zetterberg
This commit is contained in:
@@ -75,12 +75,57 @@ async function updateStaysBookingUrl(
|
|||||||
|
|
||||||
// Construct full URL with domain
|
// Construct full URL with domain
|
||||||
const domain = homeHrefs[env.NODE_ENV][lang]
|
const domain = homeHrefs[env.NODE_ENV][lang]
|
||||||
const bookingUrl = new URL(bookingUrlPath, domain)
|
let bookingUrl = new URL(bookingUrlPath, domain)
|
||||||
|
|
||||||
// Update TLD based on language
|
// Update TLD based on language
|
||||||
if (lang !== Lang.en)
|
if (lang !== Lang.en)
|
||||||
bookingUrl.host = bookingUrl.host.replace(".com", `.${lang}`)
|
bookingUrl.host = bookingUrl.host.replace(".com", `.${lang}`)
|
||||||
|
|
||||||
|
if (env.HIDE_FOR_NEXT_RELEASE) {
|
||||||
|
// Temporary Url, domain and lang support for current web
|
||||||
|
let bookingUrl = new URL(
|
||||||
|
"/hotelreservation/my-booking",
|
||||||
|
env.PUBLIC_URL || "https://www.scandichotels.com" // fallback to production for ephemeral envs (like deploy previews)
|
||||||
|
)
|
||||||
|
switch (lang) {
|
||||||
|
case Lang.sv:
|
||||||
|
bookingUrl.host = bookingUrl.host.replace(".com", ".se")
|
||||||
|
bookingUrl.pathname = "/hotelreservation/din-bokning"
|
||||||
|
break
|
||||||
|
case Lang.no:
|
||||||
|
bookingUrl.host = bookingUrl.host.replace(".com", ".no")
|
||||||
|
bookingUrl.pathname = "/hotelreservation/my-booking"
|
||||||
|
break
|
||||||
|
case Lang.da:
|
||||||
|
bookingUrl.host = bookingUrl.host.replace(".com", ".dk")
|
||||||
|
bookingUrl.pathname = "/hotelreservation/min-booking"
|
||||||
|
break
|
||||||
|
case Lang.fi:
|
||||||
|
bookingUrl.host = bookingUrl.host.replace(".com", ".fi")
|
||||||
|
bookingUrl.pathname = "/varaa-hotelli/varauksesi"
|
||||||
|
break
|
||||||
|
case Lang.de:
|
||||||
|
bookingUrl.host = bookingUrl.host.replace(".com", ".de")
|
||||||
|
bookingUrl.pathname = "/hotelreservation/my-booking"
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!!encryptedBookingValue) {
|
||||||
|
bookingUrl.searchParams.set("RefId", encryptedBookingValue)
|
||||||
|
} else {
|
||||||
|
bookingUrl.searchParams.set(
|
||||||
|
"lastName",
|
||||||
|
apiJson.data.attributes.lastName
|
||||||
|
)
|
||||||
|
bookingUrl.searchParams.set(
|
||||||
|
"bookingId",
|
||||||
|
d.attributes.confirmationNumber
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...d,
|
...d,
|
||||||
attributes: {
|
attributes: {
|
||||||
|
|||||||
Reference in New Issue
Block a user