X-Git-Url: https://git.auder.net/%3C?a=blobdiff_plain;f=server%2Fmodels%2FUser.js;h=60584275713dbdefe177a5064bdb7749c3de402d;hb=b4de2e730539cadbff94a42eccfb9cb046cbf810;hp=cf4c5293178a72707cbaa7f15e5bdd4b624e38d7;hpb=98db2082fd31e7a7bc0348e31ce119f39dbc31b3;p=vchess.git diff --git a/server/models/User.js b/server/models/User.js index cf4c5293..60584275 100644 --- a/server/models/User.js +++ b/server/models/User.js @@ -63,6 +63,16 @@ const UserModel = }); }, + getByIds: function(ids, cb) { + db.serialize(function() { + const query = + "SELECT id, name " + + "FROM Users " + + "WHERE id IN (" + ids + ")"; + db.all(query, cb); + }); + }, + ///////// // MODIFY @@ -114,6 +124,15 @@ const UserModel = db.run(query, cb); }); }, + + ///////////////// + // NOTIFICATIONS + + tryNotify: function(oppId, gid, vname, message) + { + // TODO: send email to oppId (request...) with title + // "vchess.club - vname" and content "message" + } } module.exports = UserModel;