A few fixes, drop planned problems support (replaced by forum + mode analyze)
[vchess.git] / server / routes / games.js
index 3b91e8b..a444acd 100644 (file)
@@ -34,7 +34,7 @@ router.get("/games", access.ajax, (req,res) => {
   {
     GameModel.getOne(gameId, (err,game) => {
                  access.checkRequest(res, err, game, "Game not found", () => {
-                         res.json({game: game});
+        res.json({game: game});
                  });
          });
   }
@@ -44,7 +44,7 @@ router.get("/games", access.ajax, (req,res) => {
     const userId = req.query["uid"];
     const excluded = !!req.query["excluded"];
     GameModel.getByUser(userId, excluded, (err,games) => {
-                 if (!!err)
+                       if (!!err)
         return res.json({errmsg: err.errmsg || err.toString()});
                        res.json({games: games});
          });
@@ -54,8 +54,7 @@ router.get("/games", access.ajax, (req,res) => {
 // New move + fen update + score, potentially
 // TODO: if newmove fail, takeback in GUI
 router.put("/games", access.logged, access.ajax, (req,res) => {
-       const gid = req.body.gid;
-       const oppId = req.body.oppId;
+  const gid = req.body.gid;
        const obj = req.body.newObj;
        GameModel.update(gid, obj, (err) => {
                if (!!err)