Major refactor of bonfireFramework to differentiate tests, refactor tests in Bonfire schema to remove public/private tests and only have tests, fire modal on successful run of all tests in bonfire/show, added bonfiresHash to User schema, and we should have committed a while ago because there is too much too list
This commit is contained in:
14
app.js
14
app.js
@ -285,6 +285,20 @@ app.post('/completed-challenge', function (req, res) {
|
||||
req.user.save();
|
||||
});
|
||||
|
||||
app.post('/completed-bonfire/', function (req, res) {
|
||||
req.user.challengesHash[parseInt(req.body.challengeNumber)] =
|
||||
Math.round(+new Date() / 1000);
|
||||
var ch = req.user.challengesHash;
|
||||
var p = 0;
|
||||
for (var k in ch) {
|
||||
if (ch[k] > 0) {
|
||||
p += 1;
|
||||
}
|
||||
}
|
||||
req.user.points = p;
|
||||
req.user.save();
|
||||
});
|
||||
|
||||
/**
|
||||
* OAuth sign-in routes.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user