Skip to content
This repository was archived by the owner on Feb 27, 2024. It is now read-only.

Commit cdad426

Browse files
committed
Make result more obvious
1 parent dc561f0 commit cdad426

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pages/blog/[[...slug]].js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,16 @@ export default function BlogPost({post, archive, posts, pagination}) {
8484
})}
8585
onSubmit={async (values, {setSubmitting}) => {
8686
const {author, authorEmail, authorUrl, content} = values
87-
await postComment(
87+
const response = await postComment(
8888
author,
8989
authorEmail,
9090
authorUrl,
9191
post.databaseId,
9292
content
9393
)
94+
response.error
95+
? alert(response.errorMessage)
96+
: alert(JSON.stringify(response))
9497
setSubmitting(false)
9598
}}
9699
>

0 commit comments

Comments
 (0)