improved helpers system

This commit is contained in:
Lukian 2024-09-17 13:46:50 +02:00
parent 54aeaa5bb3
commit bbaa7dca35
5 changed files with 343 additions and 24 deletions

View file

@ -29,12 +29,8 @@ router.post('/', async (req, res) => {
const connection = await getConnection();
const helpers = await getHelpers(connection, gameid)
connection.end();
if (!helpers[0]) {
return res.status(400).send({error: "this game doesn't exist in the data base"})
};
res.status(200).send(JSON.parse(helpers[0].helpers));
res.status(200).send(helpers);
});
module.exports = router;