+// Get by user ID, for MyGames page
+router.get("/runninggames", access.logged, access.ajax, (req,res) => {
+ GameModel.getRunning(req.userId, (err, games) => {
+ res.json({ games: games });
+ });
+});
+
+router.get("/completedgames", access.logged, access.ajax, (req,res) => {
+ const cursor = req.query["cursor"];
+ if (!!cursor.match(/^[0-9]+$/)) {
+ GameModel.getCompleted(req.userId, cursor, (err, games) => {
+ res.json({ games: games });
+ });
+ }
+});
+
+// FEN update + score(Msg) + draw status / and new move + chats