X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=routes%2Fproblems.js;h=43258a0cb0b20eec57d174ea7220b7f725c49475;hb=c018b304ba439ca92348dcb65715707f5cfcee05;hp=b94aa60133b1a30742179e89a39daab86f2c2274;hpb=8a477a7e1b781babc74d7935b80ac0b18ec04f86;p=vchess.git diff --git a/routes/problems.js b/routes/problems.js index b94aa601..43258a0c 100644 --- a/routes/problems.js +++ b/routes/problems.js @@ -53,14 +53,14 @@ router.put("/problems/:id([0-9]+)", access.logged, access.ajax, (req,res) => { const s = sanitizeUserInput(req.body["fen"], req.body["instructions"], req.body["solution"]); if (typeof s === "string") return res.json({errmsg: s}); - ProblemModel.update(pid, req.user._id, fen, instructions, solution); + ProblemModel.update(pid, req.userId, fen, instructions, solution); res.json({}); }); // Delete a problem router.delete("/problems/:id([0-9]+)", access.logged, access.ajax, (req,res) => { const pid = req.params["id"]; //problem ID - ProblemModel.delete(pid, req.user._id); + ProblemModel.delete(pid, req.userId); res.json({}); });