X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=server%2Fmodels%2FGame.js;h=1d2cd684c9f1cb9824892f304c963234e3c1b6a3;hp=401e36533c78565f3457884791666dac08ee07a7;hb=6c7cbfedc6ecf2b49f6b1e27a174039e92a36365;hpb=5246b49d18b711fb26ee27919ab392be24b80fba diff --git a/server/models/Game.js b/server/models/Game.js index 401e3653..1d2cd684 100644 --- a/server/models/Game.js +++ b/server/models/Game.js @@ -128,12 +128,13 @@ const GameModel = db.serialize(function() { let query = "SELECT id, vid, cadence, created, score, white, black " + - "FROM Games "; - if (uid > 0) query += - "WHERE " + - " created < " + cursor + " AND " + - " white <> " + uid + " AND " + - " black <> " + uid + " "; + "FROM Games " + + "WHERE created < " + cursor + " "; + if (uid > 0) { + query += + " AND white <> " + uid + " " + + " AND black <> " + uid + " "; + } query += "ORDER BY created DESC " + "LIMIT 20"; //TODO: 20 hard-coded...