From 7c72d5c81d25112b2cb1f192496e4b313400932b Mon Sep 17 00:00:00 2001 From: Lukian LEIZOUR Date: Sun, 2 Jun 2024 18:11:36 +0200 Subject: [PATCH] commit --- libs/mysql.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/mysql.js b/libs/mysql.js index 2819e88..70cf3cf 100644 --- a/libs/mysql.js +++ b/libs/mysql.js @@ -42,7 +42,7 @@ function getGame(gameid) { function addHelper(username, gameid) { return new Promise((resolve, reject) => { con.query( - `UPDATE games SET helpers = JSON_ARRAY_APPEND(helpers, '$', ${username}) WHERE id = ${gameid}`, + `UPDATE games SET helpers = JSON_ARRAY_APPEND(helpers, '$', "${username}") WHERE id = ${gameid}`, (error, result) => { if (error) { reject(new Error(error)); @@ -56,7 +56,7 @@ function addHelper(username, gameid) { function removeHelper(username, gameid) { return new Promise((resolve, reject) => { con.query( - `UPDATE games SET helpers = JSON_REMOVE(helpers, JSON_UNQUOTE(JSON_SEARCH(helpers, 'one', ${username}))) WHERE id = ${gameid}`, + `UPDATE games SET helpers = JSON_REMOVE(helpers, JSON_UNQUOTE(JSON_SEARCH(helpers, 'one', "${username}"))) WHERE id = ${gameid}`, (error, result) => { if (error) { reject(new Error(error));