Feat(SW-3708): refactor contentstack fetching (removing all refs) and cache invalidation * Remove all REFS * Revalidate correct language * PR fixes * PR fixes * Throw when errors from contentstack api Approved-by: Joakim Jäderberg
30 lines
902 B
TypeScript
30 lines
902 B
TypeScript
import { z } from "zod"
|
|
|
|
import { transformedImageVaultAssetSchema } from "@scandic-hotels/common/utils/imageVault"
|
|
|
|
import { BlocksEnums } from "../../../../types/blocksEnum"
|
|
import { buttonSchema } from "./utils/buttonLinkSchema"
|
|
|
|
export const joinScandicFriendsSchema = z.object({
|
|
join_scandic_friends: z.object({
|
|
show_header: z.boolean().default(false),
|
|
scripted_top_title: z.string(),
|
|
title: z.string(),
|
|
preamble: z.string(),
|
|
image: transformedImageVaultAssetSchema,
|
|
show_usp: z.boolean().default(false),
|
|
usp: z.array(z.string()),
|
|
has_primary_button: z.boolean().default(false),
|
|
primary_button: buttonSchema,
|
|
}),
|
|
})
|
|
|
|
export const joinScandicFriendsBlockSchema = z
|
|
.object({
|
|
typename: z
|
|
.literal(BlocksEnums.block.JoinScandicFriends)
|
|
.optional()
|
|
.default(BlocksEnums.block.JoinScandicFriends),
|
|
})
|
|
.merge(joinScandicFriendsSchema)
|