Merged in feat/support-for-all-page-links (pull request #1212)

Feat/support for all page links

* feat: added all page link connections to queries

* feat: updated output files


Approved-by: Fredrik Thorsson
Approved-by: Matilda Landström
This commit is contained in:
Erik Tiekstra
2025-01-27 11:21:37 +00:00
parent 527e691157
commit bf76c6277f
51 changed files with 1080 additions and 590 deletions

View File

@@ -1,7 +1,17 @@
import { z } from "zod"
import * as pageLinks from "@/server/routers/contentstack/schemas/pageLinks"
import {
accountPageSchema,
collectionPageSchema,
contentPageSchema,
destinationCityPageSchema,
destinationCountryPageSchema,
destinationOverviewPageSchema,
hotelPageSchema,
loyaltyPageSchema,
startPageSchema,
transformPageLink,
} from "../pageLinks"
import { imageSchema } from "./image"
import { imageContainerSchema } from "./imageContainer"
@@ -9,14 +19,18 @@ export const contentEmbedsSchema = z
.discriminatedUnion("__typename", [
imageContainerSchema,
imageSchema,
pageLinks.accountPageSchema,
pageLinks.contentPageSchema,
pageLinks.hotelPageSchema,
pageLinks.loyaltyPageSchema,
pageLinks.collectionPageSchema,
accountPageSchema,
collectionPageSchema,
contentPageSchema,
destinationCityPageSchema,
destinationCountryPageSchema,
destinationOverviewPageSchema,
hotelPageSchema,
loyaltyPageSchema,
startPageSchema,
])
.transform((data) => {
const link = pageLinks.transform(data)
const link = transformPageLink(data)
if (link) {
return link
}