feat(SW-2541): Adjust for ImageVault custom field return types changes
Approved-by: Bianca Widstam Approved-by: Matilda Landström
This commit is contained in:
@@ -2,18 +2,18 @@ import { z } from "zod"
|
||||
|
||||
import { findMyBooking } from "@scandic-hotels/common/constants/routes/findMyBooking"
|
||||
import { myStay } from "@scandic-hotels/common/constants/routes/myStay"
|
||||
import { transformedImageVaultAssetSchema } from "@scandic-hotels/common/utils/imageVault"
|
||||
|
||||
import { attributesSchema as hotelAttributesSchema } from "../../../routers/hotels/schemas/hotel"
|
||||
import { Country } from "../../../types/country"
|
||||
import { RTETypeEnum } from "../../../types/RTEenums"
|
||||
import { additionalDataAttributesSchema } from "../../hotels/schemas/hotel/include/additionalData"
|
||||
import { imageSchema } from "../../hotels/schemas/image"
|
||||
import { tempImageVaultAssetSchema } from "../schemas/imageVault"
|
||||
import { systemSchema } from "../schemas/system"
|
||||
|
||||
import type { Lang } from "@scandic-hotels/common/constants/language"
|
||||
import type { ImageVaultAsset } from "@scandic-hotels/common/utils/imageVault"
|
||||
|
||||
import type { ImageVaultAsset } from "../../../types/imageVault"
|
||||
import type { LanguageSwitcherData } from "../../../types/languageSwitcher"
|
||||
|
||||
const metaDataJsonSchema = z.object({
|
||||
@@ -56,7 +56,7 @@ export const rawMetadataSchema = z.object({
|
||||
title: z.string().nullish(),
|
||||
description: z.string().nullish(),
|
||||
noindex: z.boolean().nullish(),
|
||||
seo_image: tempImageVaultAssetSchema.nullable(),
|
||||
seo_image: transformedImageVaultAssetSchema,
|
||||
})
|
||||
.nullish(),
|
||||
breadcrumbs: z
|
||||
@@ -97,12 +97,12 @@ export const rawMetadataSchema = z.object({
|
||||
.object({
|
||||
heading: z.string().nullish(),
|
||||
preamble: z.string().nullish(),
|
||||
hero_image: tempImageVaultAssetSchema.nullable(),
|
||||
hero_image: transformedImageVaultAssetSchema,
|
||||
})
|
||||
.nullish(),
|
||||
hero_image: tempImageVaultAssetSchema.nullable(),
|
||||
hero_image: transformedImageVaultAssetSchema,
|
||||
images: z
|
||||
.array(z.object({ image: tempImageVaultAssetSchema }).nullish())
|
||||
.array(z.object({ image: transformedImageVaultAssetSchema }).nullish())
|
||||
.transform((images) =>
|
||||
images
|
||||
.map((image) => image?.image)
|
||||
|
||||
Reference in New Issue
Block a user