Merged in feat/rework-contentstack (pull request #3493)

Feat(SW-3708): refactor contentstack fetching (removing all refs) and cache invalidation

* Remove all REFS

* Revalidate correct language

* PR fixes

* PR fixes

* Throw when errors from contentstack api


Approved-by: Joakim Jäderberg
This commit is contained in:
Linus Flood
2026-01-27 12:38:36 +00:00
parent a5e214f783
commit 5fc93472f4
193 changed files with 489 additions and 9018 deletions

View File

@@ -3,7 +3,6 @@ import { z } from "zod"
import { removeMultipleSlashes } from "@scandic-hotels/common/utils/url"
import { HotelPageEnum } from "../../../../types/hotelPageEnum"
import { collectionPageRefSchema, contentPageRefSchema } from "../pageLinks"
export const spaPageSchema = z.object({
typename: z
@@ -46,22 +45,3 @@ export const spaPageSchema = z.object({
}
}),
})
export const spaPageRefSchema = z.object({
spa_page: z
.object({
pageConnection: z.object({
edges: z.array(
z.object({
node: z.discriminatedUnion("__typename", [
contentPageRefSchema,
collectionPageRefSchema,
]),
})
),
}),
})
.transform((data) => {
return data.pageConnection.edges.flatMap(({ node }) => node.system) || []
}),
})