Skip to content

Instantly share code, notes, and snippets.

View cdl's full-sized avatar
💭
I may be slow to respond.

Colby Ludwig cdl

💭
I may be slow to respond.
View GitHub Profile

Keybase proof

I hereby claim:

  • I am cdl on github.
  • I am cdl (https://keybase.io/cdl) on keybase.
  • I have a public key ASCLF_K6HEhtIP0yJY306U6XZ1fghbfwZq9KHZPcOdIYGgo

To claim this, I am signing this object:

diff --git a/pages/api/posts/create.js b/pages/api/posts/create.js
index e45df89..f995100 100644
--- a/pages/api/posts/create.js
+++ b/pages/api/posts/create.js
@@ -27,7 +27,7 @@ const handlePOST = async (req, res) => {
const user = await getUserFromJWT(token);
// Otherwise, post passes validations, let's create it.
- const post = await createPost({ title, content, authorId: user.id ?? null });
+ const post = await createPost({ title, content, authorId: user?.id ?? null });