projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix challenges retrieval from server
[vchess.git]
/
server
/
models
/
User.js
diff --git
a/server/models/User.js
b/server/models/User.js
index
9401133
..
6058427
100644
(file)
--- a/
server/models/User.js
+++ b/
server/models/User.js
@@
-63,14
+63,14
@@
const UserModel =
});
},
});
},
- getBy
Name: function(name
s, cb) {
-
db.serialize(function() {
-
const query =
- "SELECT id
+ getBy
Ids: function(id
s, cb) {
+ db.serialize(function() {
+ const query =
+ "SELECT id, name " +
"FROM Users " +
"FROM Users " +
-
"WHERE name IN ('" + names.join("','") + "')";
;
-
db.all(query, cb);
-
});
+
"WHERE id IN (" + ids + ")"
;
+ db.all(query, cb);
+ });
},
/////////
},
/////////
@@
-124,6
+124,15
@@
const UserModel =
db.run(query, cb);
});
},
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;
}
module.exports = UserModel;