myheats

Live heats, scoring and leaderboard for sport events
git clone https://git.in0rdr.ch/myheats.git
Log | Files | Refs | Pull requests | README | LICENSE

commit 631550d0cec9e0763191b44be611dd5861c60c95
parent ff002c4fba9fa904d05d5154b78ce05f2f25997e
Author: Andreas Gruhler <andreas.gruhler@adfinis.com>
Date:   Sat, 28 Sep 2024 09:52:48 +0200

fix(api-routing): missing break statements

Diffstat:
Msrc/api/server.cjs | 19+++++++++++++++++++
1 file changed, 19 insertions(+), 0 deletions(-)

diff --git a/src/api/server.cjs b/src/api/server.cjs @@ -113,6 +113,7 @@ server.on('request', async (req, res) => { res.end(JSON.stringify({ message: 'egg fried rice 🍚 fuiyooh!', })); + break case '/v1/auth/verify': try { const token = search_params.get('token'); @@ -149,6 +150,7 @@ server.on('request', async (req, res) => { } catch (error) { serverError(res, error); } + break case '/v1/leaderboard/allHeats': try { const heats = await db.allHeats() @@ -160,6 +162,7 @@ server.on('request', async (req, res) => { } catch(error) { serverError(res, error); } + break case '/v1/leaderboard/allAthletes': try { const athletes = await db.allAthletes() @@ -171,6 +174,7 @@ server.on('request', async (req, res) => { } catch(error) { serverError(res, error); } + break default: const pathExists = paths.find((i) => i === url.pathname); if (pathExists) { @@ -194,6 +198,7 @@ server.on('request', async (req, res) => { }); res.end(body); }) + break case '/v1/auth/requestMagicLink': req.on('data', chunk => { body.push(chunk); @@ -241,6 +246,7 @@ server.on('request', async (req, res) => { serverError(res, error); } }) + break case '/v1/leaderboard/distinctStartlist': req.on('data', chunk => { body.push(chunk); @@ -266,6 +272,7 @@ server.on('request', async (req, res) => { serverError(res, error); } }) + break case '/v1/leaderboard/startlistWithAthletes': req.on('data', chunk => { body.push(chunk); @@ -291,6 +298,7 @@ server.on('request', async (req, res) => { serverError(res, error); } }) + break case '/v1/leaderboard/scoresForHeatAndAthlete': req.on('data', chunk => { body.push(chunk); @@ -320,6 +328,7 @@ server.on('request', async (req, res) => { serverError(res, error); } }) + break case '/v1/leaderboard/scoreSummaryForHeatAndAthlete': req.on('data', chunk => { body.push(chunk); @@ -349,6 +358,7 @@ server.on('request', async (req, res) => { serverError(res, error); } }) + break case '/v1/leaderboard/getScore': req.on('data', chunk => { body.push(chunk); @@ -379,6 +389,7 @@ server.on('request', async (req, res) => { serverError(res, error); } }) + break case '/v1/leaderboard/setScore': req.on('data', chunk => { body.push(chunk); @@ -410,6 +421,7 @@ server.on('request', async (req, res) => { serverError(res, error); } }) + break case '/v1/leaderboard/newHeat': req.on('data', chunk => { body.push(chunk); @@ -439,6 +451,7 @@ server.on('request', async (req, res) => { serverError(res, error); } }) + break case '/v1/leaderboard/getHeat': req.on('data', chunk => { body.push(chunk); @@ -466,6 +479,7 @@ server.on('request', async (req, res) => { serverError(res, error); } }) + break case '/v1/leaderboard/removeHeat': req.on('data', chunk => { body.push(chunk); @@ -490,6 +504,7 @@ server.on('request', async (req, res) => { serverError(res, error); } }) + break case '/v1/leaderboard/addAthleteToHeat': req.on('data', chunk => { body.push(chunk); @@ -518,6 +533,7 @@ server.on('request', async (req, res) => { serverError(res, error); } }) + break case '/v1/leaderboard/removeAthleteFromHeat': req.on('data', chunk => { body.push(chunk); @@ -543,6 +559,7 @@ server.on('request', async (req, res) => { serverError(res, error); } }) + break case '/v1/leaderboard/addAthlete': req.on('data', chunk => { body.push(chunk); @@ -574,6 +591,7 @@ server.on('request', async (req, res) => { serverError(res, error); } }) + break case '/v1/leaderboard/removeAthlete': req.on('data', chunk => { body.push(chunk); @@ -598,6 +616,7 @@ server.on('request', async (req, res) => { serverError(res, error); } }) + break default: const pathExists = paths.find((i) => i === url.pathname); if (pathExists) {