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,8 +1,18 @@
import { z } from "zod"
import * as pageLinks from "@/server/routers/contentstack/schemas/pageLinks"
import { tempImageVaultAssetSchema } from "../imageVault"
import {
accountPageSchema,
collectionPageSchema,
contentPageSchema,
destinationCityPageSchema,
destinationCountryPageSchema,
destinationOverviewPageSchema,
hotelPageSchema,
loyaltyPageSchema,
startPageSchema,
transformPageLink,
} from "../pageLinks"
import { systemSchema } from "../system"
import { buttonSchema } from "./utils/buttonLinkSchema"
import { linkConnectionRefsSchema } from "./utils/linkConnection"
@@ -71,14 +81,18 @@ export const teaserCardBlockSchema = z.object({
.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
}