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.

minor

Roman Pominov9b1373ca412c
diff --git a/apps/designer/app/shared/db/build.server.ts b/apps/designer/app/shared/db/build.server.ts
index b5c3d82d93..05efa17a04 100644
--- a/apps/designer/app/shared/db/build.server.ts
+++ b/apps/designer/app/shared/db/build.server.ts
@@ -1,7 +1,7 @@
import { prisma, Build as DbBuild } from "@webstudio-is/prisma-client";
import { z } from "zod";
-const Page = z.object({
+const PageSchema = z.object({
id: z.string(),
name: z.string(),
path: z.string(),
@@ -10,14 +10,16 @@ const Page = z.object({
treeId: z.string(),
});
-type Page = z.infer<typeof Page>;
+type Page = z.infer<typeof PageSchema>;
-const Pages: z.ZodType<{ homePage: Page; pages: Array<Page> }> = z.object({
- homePage: Page,
- pages: z.array(Page),
-});
+const PagesSchema: z.ZodType<{ homePage: Page; pages: Array<Page> }> = z.object(
+ {
+ homePage: PageSchema,
+ pages: z.array(PageSchema),
+ }
+);
-type Pages = z.infer<typeof Pages>;
+type Pages = z.infer<typeof PagesSchema>;
type Build = {
id: DbBuild["id"];
diff --git a/packages/prisma-client/prisma/migrations/20220909124542_move_to_builds/migration.ts b/packages/prisma-client/prisma/migrations/20220909124542_move_to_builds/migration.ts
index d6138f1a2d..59d41183fb 100644
--- a/packages/prisma-client/prisma/migrations/20220909124542_move_to_builds/migration.ts
+++ b/packages/prisma-client/prisma/migrations/20220909124542_move_to_builds/migration.ts
@@ -31,7 +31,9 @@ export default () => {
(project) =>
project.devTreeId === tree.id ||
project.prodTreeId === tree.id ||
- TreeHistorySchema.parse(project.prodTreeIdHistory).includes(tree.id)
+ TreeHistorySchema.parse(
+ JSON.parse(project.prodTreeIdHistory)
+ ).includes(tree.id)
);
if (project === undefined) {