Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

validate root when patching it

Oleg Isonen4bf8e3dbc21f
diff --git a/apps/designer/app/shared/db/tree.server.ts b/apps/designer/app/shared/db/tree.server.ts
index 095bce7512..cf8c194d64 100644
--- a/apps/designer/app/shared/db/tree.server.ts
+++ b/apps/designer/app/shared/db/tree.server.ts
@@ -119,6 +119,7 @@ export const patchRoot = async (
throw new Error(`Tree ${treeId} not found`);
}
const root = applyPatches(tree.root, patches);
+ InstanceSchema.parse(root);
await prisma.tree.update({
data: { root: JSON.stringify(root) },
where: { id: treeId },