From 0f70b811f9b481ec9cbfdde31d3a9600057d3187 Mon Sep 17 00:00:00 2001
From: Jonas Leder <jonas@jonasled.de>
Date: Thu, 7 Apr 2022 09:26:20 +0200
Subject: [PATCH] fix new comment

---
 js/customElements/newComment.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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 = "<jl-new_comment></jl-new_comment>"
                 } else {
-- 
GitLab