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.

Don't show "Path must start with a /" when it's empty

Roman Pominov0d6cdd72520e
diff --git a/apps/designer/app/routes/rest/pages.$projectId.ts b/apps/designer/app/routes/rest/pages.$projectId.ts
index 196851ea84..d2ce939e7a 100644
--- a/apps/designer/app/routes/rest/pages.$projectId.ts
+++ b/apps/designer/app/routes/rest/pages.$projectId.ts
@@ -20,7 +20,10 @@ const CreatePageInput = zfd.formData({
.refine((path) => path !== "/", "Path can't be /")
.transform((path) => (path.endsWith("/") ? path.slice(0, -1) : path))
.transform((path) => path.replace(/\/\//g, "/"))
- .refine((path) => path.startsWith("/"), "Path must start with a /"),
+ .refine(
+ (path) => path === "" || path.startsWith("/"),
+ "Path must start with a /"
+ ),
});
const handlePUT = async (