Skip to content

Commit ef4236d

Browse files
committed
feat: extend ClipboardDataSchema to support legacy SerializedNodeSchemaV1
1 parent adb9e01 commit ef4236d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

packages/chaingraph-trpc/server/procedures/flow/paste-nodes.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ import type {
1212
IPort,
1313
SerializedEdge,
1414
} from '@badaitech/chaingraph-types'
15+
import {
16+
SerializedNodeSchemaV1Legacy,
17+
} from '@badaitech/chaingraph-types'
1518
import {
1619
isObjectPortConfig,
1720
} from '@badaitech/chaingraph-types'
@@ -27,7 +30,7 @@ const PositionSchema = z.object({
2730
})
2831

2932
const ClipboardDataSchema = z.object({
30-
nodes: z.array(SerializedNodeSchema),
33+
nodes: z.array(z.union([SerializedNodeSchema, SerializedNodeSchemaV1Legacy])),
3134
edges: z.array(SerializedEdgeSchema),
3235
timestamp: z.number().optional().default(() => Date.now()),
3336
})

0 commit comments

Comments
 (0)