From 54aeaa5bb3c28230d22f58099ccc4d7fc660b931 Mon Sep 17 00:00:00 2001 From: Lukian Date: Mon, 16 Sep 2024 18:05:04 +0200 Subject: [PATCH] commit --- api/v1/admin/verifyUser.js | 3 +-- api/v1/games/getHelpers.js | 2 +- api/v1/games/removeHelper.js | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/api/v1/admin/verifyUser.js b/api/v1/admin/verifyUser.js index 5b2b8c8..2f7d5ac 100644 --- a/api/v1/admin/verifyUser.js +++ b/api/v1/admin/verifyUser.js @@ -27,7 +27,6 @@ router.post('/', async (req, res) => { } const connection = await getConnection(); - const user = await getUser(connection, username); if (!user[0]) { @@ -38,7 +37,7 @@ router.post('/', async (req, res) => { return res.status(400).send({error: "user already verified"}); } - await setVerified(username); + await setVerified(connection, username); connection.end() res.status(200).send({message: "user verified"}); }); diff --git a/api/v1/games/getHelpers.js b/api/v1/games/getHelpers.js index 5480b67..8283f8d 100644 --- a/api/v1/games/getHelpers.js +++ b/api/v1/games/getHelpers.js @@ -27,7 +27,7 @@ router.post('/', async (req, res) => { } const connection = await getConnection(); - const helpers = await getHelpers(gameid) + const helpers = await getHelpers(connection, gameid) connection.end(); if (!helpers[0]) { diff --git a/api/v1/games/removeHelper.js b/api/v1/games/removeHelper.js index 0bfce9b..2f47049 100644 --- a/api/v1/games/removeHelper.js +++ b/api/v1/games/removeHelper.js @@ -24,7 +24,7 @@ router.post('/', async (req, res) => { } const connection = await getConnection(); - const game = await getGame(gameid); + const game = await getGame(connection, gameid); if (!game[0]) { return res.status(400).send({error: "this game doesn't exist"}); @@ -34,7 +34,7 @@ router.post('/', async (req, res) => { return res.status(400).send({error: "you are not an helper for this game"}); } - await removeHelper(user.user.username, gameid); + await removeHelper(connection, user.user.username, gameid); connection.end() } catch { return res.status(400).send({error: "invalid token"});