feat(SW-1818): Refactored sysAsset handling to support PDF links
Approved-by: Matilda Landström
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import { z } from "zod"
|
||||
|
||||
import { imageRefsSchema, imageSchema } from "../blocks/image"
|
||||
import {
|
||||
imageContainerRefsSchema,
|
||||
imageContainerSchema,
|
||||
} from "../blocks/imageContainer"
|
||||
import { sysAssetRefsSchema, sysAssetSchema } from "../blocks/sysAsset"
|
||||
import {
|
||||
linkRefsUnionSchema,
|
||||
linkUnionSchema,
|
||||
@@ -29,7 +29,7 @@ export const contentSchema = z.object({
|
||||
node: z
|
||||
.discriminatedUnion("__typename", [
|
||||
imageContainerSchema,
|
||||
imageSchema,
|
||||
sysAssetSchema,
|
||||
...linkUnionSchema.options,
|
||||
])
|
||||
.transform((data) => {
|
||||
@@ -70,7 +70,7 @@ export const contentRefsSchema = z.object({
|
||||
edges: z.array(
|
||||
z.object({
|
||||
node: z.discriminatedUnion("__typename", [
|
||||
imageRefsSchema,
|
||||
sysAssetRefsSchema,
|
||||
...actualRefs.options,
|
||||
]),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user