X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=routes%2Fplaying.js;h=7af0a1bc1709da9616d646a758116ea559e213a6;hp=37592c9d3ca8c9a02f2a765b924fdb2622776b5a;hb=fd08ab2c5b8931bb8c95cf7e9f2f95122647f991;hpb=2305d34a3f2ab561c20b1fcb7349320145ac1f5c diff --git a/routes/playing.js b/routes/playing.js index 37592c9d..7af0a1bc 100644 --- a/routes/playing.js +++ b/routes/playing.js @@ -90,12 +90,8 @@ router.get("/gamesbyplayer", access.logged, access.ajax, (req,res) => { }); }); -// Load a rules page -router.get("/rules/:variant([a-zA-Z0-9]+)", access.ajax, (req,res) => { - res.render("rules/" + req.params["variant"]); -}); - // TODO: if newmove fail, takeback in GUI // TODO: check move structure +// TODO: for corr games, move should contain an optional "message" field ("corr chat" !) router.post("/moves", access.logged, access.ajax, (req,res) => { let gid = ObjectId(req.body.gid); let fen = req.body.fen; @@ -111,16 +107,4 @@ router.post("/moves", access.logged, access.ajax, (req,res) => { }); }); -//TODO: if new chat fails, do not show chat message locally -router.post("/chats", access.logged, access.ajax, (req,res) => { - let gid = ObjectId(req.body.gid); - let uid = ObjectId(req.body.uid); - let msg = req.body.msg; //TODO: sanitize HTML (strip all tags...) - GameModel.addChat(gid, uid, msg, (err,game) => { - access.checkRequest(res, err, game, "Cannot find game", () => { - res.json({}); - }); - }); -}); - module.exports = router;