diff --git a/js/customElements/newComment.js b/js/customElements/newComment.js index b7c372f..7611e9b 100644 --- a/js/customElements/newComment.js +++ b/js/customElements/newComment.js @@ -106,7 +106,7 @@ class newComment extends HTMLElement { } var graphql = JSON.stringify({ - query: 'mutation($article: String!, $name: String!, $hCaptchaResponse: String!, $email: String!, $comment: String!) { newComment(article: $article, name: $name, email: $email, comment: $comment, hCaptchaResponse: $hCaptchaResponse)}', + query: 'mutation($article: String!, $name: String!, $hCaptchaResponse: String!, $email: String!, $comment: String!) { comment(article: $article, name: $name, email: $email, comment: $comment, hCaptchaResponse: $hCaptchaResponse)}', variables: { "article": pageName, "name": nameInput.value, @@ -121,7 +121,7 @@ class newComment extends HTMLElement { headers: { 'Content-Type': 'application/json' } }; let data = (await (await fetch("/API/graphql.php", requestOptions)).json()).data; - if (data.newComment == "OK") { + if (data.comment == "OK") { document.querySelector("jl-comments_display").getComments(); parent.innerHTML = "" } else {