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
26 lines
566 B
TypeScript
26 lines
566 B
TypeScript
import { z } from "zod"
|
|
|
|
import { BlocksEnums } from "../../../../types/blocksEnum"
|
|
|
|
export const jotformSchema = z.object({
|
|
typename: z
|
|
.literal(BlocksEnums.block.Jotform)
|
|
.optional()
|
|
.default(BlocksEnums.block.Jotform),
|
|
jotform: z
|
|
.object({
|
|
formConnection: z.object({
|
|
edges: z.array(
|
|
z.object({
|
|
node: z.object({
|
|
form_id: z.string().nullish(),
|
|
}),
|
|
})
|
|
),
|
|
}),
|
|
})
|
|
.transform((data) => {
|
|
return data.formConnection.edges[0]?.node || null
|
|
}),
|
|
})
|