fix new comment
This commit is contained in:
parent
7b56fbbdcd
commit
0f70b811f9
1 changed files with 2 additions and 2 deletions
|
@ -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 = "<jl-new_comment></jl-new_comment>"
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue