diff --git a/src/pages/api/[...path].ts b/src/pages/api/[...path].ts index cd9c686..6d32f90 100644 --- a/src/pages/api/[...path].ts +++ b/src/pages/api/[...path].ts @@ -26,7 +26,8 @@ const app = new Hono<{ Bindings: AstroContext }>() .post("/notes/:id", async (c) => { const id = c.req.param("id"); const props: Record = c.req.query(); - if (!props.draft && !props.homepage) { + const draft = props.draft ? props.draft === "true" : false; + if (!draft && !props.homepage) { let slug = props.slug || slugify(props.title); if (isULID(slug)) { throw new Error("Title or H1s should not be a ULID");