commit
This commit is contained in:
parent
a7a8565728
commit
7c72d5c81d
1 changed files with 2 additions and 2 deletions
|
@ -42,7 +42,7 @@ function getGame(gameid) {
|
||||||
function addHelper(username, gameid) {
|
function addHelper(username, gameid) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
con.query(
|
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) => {
|
(error, result) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
reject(new Error(error));
|
reject(new Error(error));
|
||||||
|
@ -56,7 +56,7 @@ function addHelper(username, gameid) {
|
||||||
function removeHelper(username, gameid) {
|
function removeHelper(username, gameid) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
con.query(
|
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) => {
|
(error, result) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
reject(new Error(error));
|
reject(new Error(error));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue