projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix corr notification bug
[vchess.git]
/
server
/
models
/
User.js
diff --git
a/server/models/User.js
b/server/models/User.js
index
c50cdb7
..
d91045b
100644
(file)
--- a/
server/models/User.js
+++ b/
server/models/User.js
@@
-37,11
+37,11
@@
const UserModel = {
},
// Find one user by id, name, email, or token
},
// Find one user by id, name, email, or token
- getOne: function(by, value, cb) {
+ getOne: function(by, value,
fields,
cb) {
const delimiter = (typeof value === "string" ? "'" : "");
db.serialize(function() {
const query =
const delimiter = (typeof value === "string" ? "'" : "");
db.serialize(function() {
const query =
- "SELECT
*
" +
+ "SELECT
" + fields + "
" +
"FROM Users " +
"WHERE " + by + " = " + delimiter + value + delimiter;
db.get(query, cb);
"FROM Users " +
"WHERE " + by + " = " + delimiter + value + delimiter;
db.get(query, cb);
@@
-139,7
+139,7
@@
const UserModel = {
},
tryNotify: function(id, message) {
},
tryNotify: function(id, message) {
- UserModel.getOne("id", id,
(err,
user) => {
+ UserModel.getOne("id", id,
"name, email, notify", (err,
user) => {
if (!err && user.notify) UserModel.notify(user, message);
});
},
if (!err && user.notify) UserModel.notify(user, message);
});
},