fix(SW-194): adapt to separated ContentPage query
This commit is contained in:
@@ -165,6 +165,12 @@ export const contentPageSchema = z.object({
|
|||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
export const contentPageSchemaBlocks = z.object({
|
||||||
|
content_page: z.object({
|
||||||
|
blocks: discriminatedUnionArray(blocksSchema.options).nullable(),
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
|
||||||
/** REFS */
|
/** REFS */
|
||||||
const contentPageCardsRefs = z
|
const contentPageCardsRefs = z
|
||||||
.object({
|
.object({
|
||||||
|
|||||||
@@ -18,7 +18,10 @@ import {
|
|||||||
TrackingChannelEnum,
|
TrackingChannelEnum,
|
||||||
type TrackingSDKPageData,
|
type TrackingSDKPageData,
|
||||||
} from "@/types/components/tracking"
|
} from "@/types/components/tracking"
|
||||||
import type { GetContentPageSchema } from "@/types/trpc/routers/contentstack/contentPage"
|
import type {
|
||||||
|
GetContentPageSchema,
|
||||||
|
GetContentPageSchemaBlocks,
|
||||||
|
} from "@/types/trpc/routers/contentstack/contentPage"
|
||||||
|
|
||||||
export const contentPageQueryRouter = router({
|
export const contentPageQueryRouter = router({
|
||||||
get: contentstackExtendedProcedureUID.query(async ({ ctx }) => {
|
get: contentstackExtendedProcedureUID.query(async ({ ctx }) => {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import {
|
|||||||
blocksSchema,
|
blocksSchema,
|
||||||
contentPageRefsSchema,
|
contentPageRefsSchema,
|
||||||
contentPageSchema,
|
contentPageSchema,
|
||||||
|
contentPageSchemaBlocks,
|
||||||
sidebarSchema,
|
sidebarSchema,
|
||||||
} from "@/server/routers/contentstack/contentPage/output"
|
} from "@/server/routers/contentstack/contentPage/output"
|
||||||
|
|
||||||
@@ -16,6 +17,9 @@ export interface ContentPageRefs
|
|||||||
export interface GetContentPageSchema
|
export interface GetContentPageSchema
|
||||||
extends z.input<typeof contentPageSchema> {}
|
extends z.input<typeof contentPageSchema> {}
|
||||||
|
|
||||||
|
export interface GetContentPageSchemaBlocks
|
||||||
|
extends z.input<typeof contentPageSchemaBlocks> {}
|
||||||
|
|
||||||
export interface ContentPage extends z.output<typeof contentPageSchema> {}
|
export interface ContentPage extends z.output<typeof contentPageSchema> {}
|
||||||
|
|
||||||
export type Block = z.output<typeof blocksSchema>
|
export type Block = z.output<typeof blocksSchema>
|
||||||
|
|||||||
Reference in New Issue
Block a user