fix(SW-190): moved types from output to own file inside /types
This commit is contained in:
@@ -2,8 +2,6 @@ import { z } from "zod"
|
||||
|
||||
import { Lang } from "@/constants/languages"
|
||||
|
||||
import { ImageVaultAsset } from "@/types/components/imageVaultImage"
|
||||
|
||||
export const validateContentPageSchema = z.object({
|
||||
content_page: z.object({
|
||||
title: z.string(),
|
||||
@@ -20,11 +18,3 @@ export const validateContentPageSchema = z.object({
|
||||
}),
|
||||
}),
|
||||
})
|
||||
|
||||
export type ContentPageDataRaw = z.infer<typeof validateContentPageSchema>
|
||||
|
||||
type ContentPageRaw = ContentPageDataRaw["content_page"]
|
||||
|
||||
export type ContentPage = Omit<ContentPageRaw, "hero_image"> & {
|
||||
hero_image?: ImageVaultAsset
|
||||
}
|
||||
|
||||
@@ -6,16 +6,16 @@ import { contentstackExtendedProcedureUID, router } from "@/server/trpc"
|
||||
|
||||
import { makeImageVaultImage } from "@/utils/imageVault"
|
||||
|
||||
import {
|
||||
ContentPage,
|
||||
ContentPageDataRaw,
|
||||
validateContentPageSchema,
|
||||
} from "./output"
|
||||
import { validateContentPageSchema } from "./output"
|
||||
|
||||
import {
|
||||
TrackingChannelEnum,
|
||||
TrackingSDKPageData,
|
||||
} from "@/types/components/tracking"
|
||||
import {
|
||||
ContentPage,
|
||||
ContentPageDataRaw,
|
||||
} from "@/types/trpc/routers/contentstack/contentPage"
|
||||
|
||||
export const contentPageQueryRouter = router({
|
||||
get: contentstackExtendedProcedureUID.query(async ({ ctx }) => {
|
||||
|
||||
13
types/trpc/routers/contentstack/contentPage.ts
Normal file
13
types/trpc/routers/contentstack/contentPage.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { z } from "zod"
|
||||
|
||||
import { validateContentPageSchema } from "@/server/routers/contentstack/contentPage/output"
|
||||
|
||||
import { ImageVaultAsset } from "@/types/components/imageVaultImage"
|
||||
|
||||
export type ContentPageDataRaw = z.infer<typeof validateContentPageSchema>
|
||||
|
||||
type ContentPageRaw = ContentPageDataRaw["content_page"]
|
||||
|
||||
export type ContentPage = Omit<ContentPageRaw, "hero_image"> & {
|
||||
hero_image?: ImageVaultAsset
|
||||
}
|
||||
Reference in New Issue
Block a user