Skip to content

Commit

Permalink
fix saveDraft return
Browse files Browse the repository at this point in the history
  • Loading branch information
ianmacartney committed Oct 11, 2024
1 parent 052d1ba commit df82486
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion convex/versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ export const saveDraft = mutation({
if (!id) {
id = await ctx.db.insert("posts", data);
}
return await ctx.db.insert("versions", { ...data, editorId, postId: id });
return (await ctx.db.get(
await ctx.db.insert("versions", { ...data, editorId, postId: id }),
))!;
},
});

Expand Down

0 comments on commit df82486

Please sign in to comment.