fix(SW-190): added imageVaultAsset schema
This commit is contained in:
@@ -2,6 +2,8 @@ import { z } from "zod"
|
||||
|
||||
import { Lang } from "@/constants/languages"
|
||||
|
||||
import { imageVaultAssetSchema } from "../schemas/imageVault"
|
||||
|
||||
export const validateContentPageSchema = z.object({
|
||||
content_page: z.object({
|
||||
title: z.string(),
|
||||
@@ -9,7 +11,7 @@ export const validateContentPageSchema = z.object({
|
||||
heading: z.string(),
|
||||
preamble: z.string(),
|
||||
}),
|
||||
hero_image: z.any().nullable(),
|
||||
hero_image: imageVaultAssetSchema.nullable().optional(),
|
||||
system: z.object({
|
||||
uid: z.string(),
|
||||
locale: z.nativeEnum(Lang),
|
||||
|
||||
@@ -45,7 +45,7 @@ export const contentPageQueryRouter = router({
|
||||
const contentPageData = validatedContentPage.data.content_page
|
||||
const contentPage: ContentPage = {
|
||||
...contentPageData,
|
||||
hero_image: makeImageVaultImage(contentPageData.hero_image),
|
||||
heroImage: makeImageVaultImage(contentPageData.hero_image),
|
||||
}
|
||||
|
||||
const tracking: TrackingSDKPageData = {
|
||||
|
||||
Reference in New Issue
Block a user