Merged in chore/move-enter-details (pull request #2778)
Chore/move enter details Approved-by: Anton Gunnarsson
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import { z } from "zod"
|
||||
|
||||
import { findMyBooking } from "@scandic-hotels/common/constants/routes/findMyBooking"
|
||||
import {
|
||||
type FindMyBookingRoute,
|
||||
findMyBookingRoutes,
|
||||
} from "@scandic-hotels/common/constants/routes/findMyBookingRoutes"
|
||||
import { myStay } from "@scandic-hotels/common/constants/routes/myStay"
|
||||
import { transformedImageVaultAssetSchema } from "@scandic-hotels/common/utils/imageVault"
|
||||
|
||||
@@ -168,9 +171,9 @@ export interface RawMetadataSchema extends z.output<typeof rawMetadataSchema> {}
|
||||
// Several pages are not currently routed within contentstack context.
|
||||
// This function is used to generate the urls for these pages.
|
||||
export function getNonContentstackUrls(lang: Lang, pathName: string) {
|
||||
if (Object.values(findMyBooking).includes(pathName)) {
|
||||
if (isFindMyBookingUrl(pathName)) {
|
||||
const urls: LanguageSwitcherData = {}
|
||||
return Object.entries(findMyBooking).reduce((acc, [lang, url]) => {
|
||||
return Object.entries(findMyBookingRoutes).reduce((acc, [lang, url]) => {
|
||||
acc[lang as Lang] = { url }
|
||||
return urls
|
||||
}, urls)
|
||||
@@ -203,3 +206,9 @@ const baseUrls: LanguageSwitcherData = {
|
||||
function hotelreservation(lang: Lang) {
|
||||
return `/${lang}/hotelreservation`
|
||||
}
|
||||
|
||||
function isFindMyBookingUrl(value: string): value is FindMyBookingRoute {
|
||||
return Object.values(
|
||||
findMyBookingRoutes as unknown as readonly string[]
|
||||
).includes(value)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user