feat(SW-1818): Refactored sysAsset handling to support PDF links
Approved-by: Matilda Landström
This commit is contained in:
@@ -5,7 +5,7 @@ import {
|
||||
linkUnionSchema,
|
||||
transformPageLink,
|
||||
} from "../pageLinks"
|
||||
import { imageRefsSchema, imageSchema } from "./image"
|
||||
import { sysAssetRefsSchema, sysAssetSchema } from "./sysAsset"
|
||||
|
||||
import { BlocksEnums } from "@/types/enums/blocks"
|
||||
import { ContentEnum } from "@/types/enums/content"
|
||||
@@ -26,7 +26,7 @@ export const textColsSchema = z.object({
|
||||
z.object({
|
||||
node: z
|
||||
.discriminatedUnion("__typename", [
|
||||
imageSchema,
|
||||
sysAssetSchema,
|
||||
...linkUnionSchema.options,
|
||||
])
|
||||
.transform((data) => {
|
||||
@@ -59,7 +59,7 @@ export const textColsRefsSchema = z.object({
|
||||
edges: z.array(
|
||||
z.object({
|
||||
node: z.discriminatedUnion("__typename", [
|
||||
imageRefsSchema,
|
||||
sysAssetRefsSchema,
|
||||
...linkRefsUnionSchema.options,
|
||||
]),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user