Skip to content

Commit

Permalink
Support 'false' for draft
Browse files Browse the repository at this point in the history
  • Loading branch information
zephraph authored and gitbutler-client committed Sep 16, 2024
1 parent b0e3939 commit 093f5af
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pages/api/[...path].ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ const app = new Hono<{ Bindings: AstroContext }>()
.post("/notes/:id", async (c) => {
const id = c.req.param("id");
const props: Record<string, any> = 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");
Expand Down

0 comments on commit 093f5af

Please sign in to comment.