From 1d4417af9b6b4a314f87a4e3e3ce945de731e991 Mon Sep 17 00:00:00 2001 From: Lukian Date: Mon, 16 Sep 2024 17:58:43 +0200 Subject: [PATCH] commit --- api/v1/games/addHelper.js | 2 +- api/v1/games/getGame.js | 2 +- api/v1/games/getHelpers.js | 2 +- api/v1/games/getall.js | 2 +- api/v1/games/removeHelper.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/api/v1/games/addHelper.js b/api/v1/games/addHelper.js index c7895dd..4165bc8 100644 --- a/api/v1/games/addHelper.js +++ b/api/v1/games/addHelper.js @@ -23,7 +23,7 @@ router.post('/', async (req, res) => { return res.status(400).send({error: "token expired"}); } - const connection = getConnection(); + const connection = await getConnection(); const game = await getGame(connection, gameid); diff --git a/api/v1/games/getGame.js b/api/v1/games/getGame.js index f3f29de..d0cb51a 100644 --- a/api/v1/games/getGame.js +++ b/api/v1/games/getGame.js @@ -26,7 +26,7 @@ router.post('/', async (req, res) => { return res.status(400).send({error: "invalid token"}); } - const connection = getConnection(); + const connection = await getConnection(); const game = await getGame(connection, gameid) connection.end(); diff --git a/api/v1/games/getHelpers.js b/api/v1/games/getHelpers.js index b22442b..5480b67 100644 --- a/api/v1/games/getHelpers.js +++ b/api/v1/games/getHelpers.js @@ -26,7 +26,7 @@ router.post('/', async (req, res) => { return res.status(400).send({error: "invalid token"}); } - const connection = getConnection(); + const connection = await getConnection(); const helpers = await getHelpers(gameid) connection.end(); diff --git a/api/v1/games/getall.js b/api/v1/games/getall.js index 21563dd..b032c16 100644 --- a/api/v1/games/getall.js +++ b/api/v1/games/getall.js @@ -22,7 +22,7 @@ router.post('/', async (req, res) => { return res.status(400).send({error: "invalid token"}); } - const connection = getConnection(); + const connection = await getConnection(); const games = await getGames(); connection.end(); res.status(200).send(games); diff --git a/api/v1/games/removeHelper.js b/api/v1/games/removeHelper.js index 5231de1..0bfce9b 100644 --- a/api/v1/games/removeHelper.js +++ b/api/v1/games/removeHelper.js @@ -23,7 +23,7 @@ router.post('/', async (req, res) => { return res.status(400).send({error: "token expired"}); } - const connection = getConnection(); + const connection = await getConnection(); const game = await getGame(gameid); if (!game[0]) {