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

Commit c0bad95

Browse files
committed
Add success field to comment response
1 parent 6f18586 commit c0bad95

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

api/frontend/wp/comments/mutationAddComment.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const mutationAddComment = gql`
1818
postId: $postId,
1919
content: $content
2020
) @rest(type: "Comments", path: "${wpDataEndpoints.postComment}?{args}") {
21+
success
2122
comment {
2223
${commentsFields}
2324
}

api/wordpress/_global/postCommentToPost.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export default async function postCommentToPost(
3636
// Set up return object.
3737
const response = {
3838
apolloClient,
39+
success: false,
3940
comment: null
4041
}
4142

@@ -61,6 +62,7 @@ export default async function postCommentToPost(
6162
return null
6263
}
6364

65+
response.success = data.createComment.success
6466
response.comment = data.createComment.comment
6567
})
6668
.catch((error) => {

api/wordpress/comments/mutationCommentToPost.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const mutationCommentToPost = gql`
1919
content: $content
2020
}
2121
) {
22+
success
2223
comment {
2324
${commentsFields}
2425
}

0 commit comments

Comments
 (0)