From cd83a4944a8010c62c6f7488d25ad613f4c04a3d Mon Sep 17 00:00:00 2001 From: Felix Albrigtsen Date: Sat, 23 Apr 2022 12:42:29 +0200 Subject: [PATCH] Removed excess logging, allowed tournament create --- src/server/index.js | 8 ++++---- src/server/tmdb.js | 4 ---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/server/index.js b/src/server/index.js index 9edcb27..7a23223 100644 --- a/src/server/index.js +++ b/src/server/index.js @@ -356,10 +356,10 @@ api.post("/team/:teamId/edit", (req, res) => { //Takes JSON body api.post("/tournament/create", async (req, res) => { - if (!(await isManager(req.session))) { - res.json({"status": "error", "data": "Not authorized"}); - return - } + // if (!(await isManager(req.session))) { + // res.json({"status": "error", "data": "Not authorized"}); + // return + // } //Check that req body is valid if (req.body.name == undefined || req.body.name == "") { res.json({"status": "error", "data": "No data supplied"}); diff --git a/src/server/tmdb.js b/src/server/tmdb.js index 842ddeb..bdd3423 100644 --- a/src/server/tmdb.js +++ b/src/server/tmdb.js @@ -420,14 +420,11 @@ async function assignFirstMatch(teamId, tournamentId) { let matches = await getMatchesByTournamentId(tournamentId); let highTier = Math.log2(tournament.teamLimit)-1; - console.log(highTier); let highTierMatches = matches.filter(match => match.tier == highTier); - console.log(matches); return new Promise(function(resolve, reject) { for (let match of highTierMatches) { if (match.team1Id == null) { - console.log("Assigning team " + teamId + " to match " + match.id + " as team 1"); connection.query("UPDATE matches SET team1Id = ? WHERE id = ?", [escapeString(teamId), escapeString(match.id)], (err, sets) => { if (err) { console.log(err); @@ -438,7 +435,6 @@ async function assignFirstMatch(teamId, tournamentId) { }); return } else if (match.team2Id == null) { - console.log("Assigning team " + teamId + " to match " + match.id + " as team 2"); connection.query("UPDATE matches SET team2Id = ? WHERE id = ?", [escapeString(teamId), escapeString(match.id)], (err, sets) => { if (err) { console.log(err);