Skip to content
Snippets Groups Projects
Commit b3a495c8 authored by Tobias Ørstad's avatar Tobias Ørstad
Browse files

Fixes

parent 38cd8c90
No related branches found
No related tags found
1 merge request!96Resolve "Backend cleanup"
...@@ -68,7 +68,6 @@ module.exports = { ...@@ -68,7 +68,6 @@ module.exports = {
{ {
$pull: { players: { $in: players } }, $pull: { players: { $in: players } },
$inc: { currentPlayers: -players.length }, $inc: { currentPlayers: -players.length },
$set: { active: !end },
}, },
(err, result) => { (err, result) => {
if (err) { if (err) {
......
...@@ -195,6 +195,11 @@ router.post("/join", (req, res) => { ...@@ -195,6 +195,11 @@ router.post("/join", (req, res) => {
res.sendStatus(500); // Internal server error res.sendStatus(500); // Internal server error
return; return;
} }
if (!req.body.playerId) {
res.sendStatus(400);
return;
}
let playerId; let playerId;
try { try {
playerId = mongo.ObjectID(req.body.playerId); playerId = mongo.ObjectID(req.body.playerId);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment