feat(SW-66, SW-348): search functionality and ui
This commit is contained in:
23
server/routers/contentstack/schemas/blocks/contentEmbeds.ts
Normal file
23
server/routers/contentstack/schemas/blocks/contentEmbeds.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { z } from "zod"
|
||||
|
||||
import * as pageLinks from "@/server/routers/contentstack/schemas/pageLinks"
|
||||
|
||||
import { imageSchema } from "./image"
|
||||
import { imageContainerSchema } from "./imageContainer"
|
||||
|
||||
export const contentEmbedsSchema = z
|
||||
.discriminatedUnion("__typename", [
|
||||
imageContainerSchema,
|
||||
imageSchema,
|
||||
pageLinks.accountPageSchema,
|
||||
pageLinks.contentPageSchema,
|
||||
pageLinks.hotelPageSchema,
|
||||
pageLinks.loyaltyPageSchema,
|
||||
])
|
||||
.transform((data) => {
|
||||
const link = pageLinks.transform(data)
|
||||
if (link) {
|
||||
return link
|
||||
}
|
||||
return data
|
||||
})
|
||||
Reference in New Issue
Block a user