projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
'update'
[vchess.git]
/
server
/
models
/
Challenge.js
diff --git
a/server/models/Challenge.js
b/server/models/Challenge.js
index
01de6b5
..
fa0407d
100644
(file)
--- a/
server/models/Challenge.js
+++ b/
server/models/Challenge.js
@@
-1,4
+1,5
@@
var db = require("../utils/database");
var db = require("../utils/database");
+const UserModel = require("./User");
/*
* Structure:
/*
* Structure:
@@
-21,6
+22,8
@@
const ChallengeModel =
return "Wrong characters in time control";
if (!c.fen.match(/^[a-zA-Z0-9, /-]*$/))
return "Bad FEN string";
return "Wrong characters in time control";
if (!c.fen.match(/^[a-zA-Z0-9, /-]*$/))
return "Bad FEN string";
+ if (!!c.to)
+ return UserModel.checkNameEmail({name: c.to});
return "";
},
return "";
},
@@
-53,7
+56,7
@@
const ChallengeModel =
});
},
});
},
- //
a
ll challenges except where target is defined and not me
+ //
A
ll challenges except where target is defined and not me
getByUser: function(uid, cb)
{
db.serialize(function() {
getByUser: function(uid, cb)
{
db.serialize(function() {