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:
Nathan Leniz
2015-01-24 00:44:08 -05:00
parent 37daf55719
commit 6b4475a5b8
12 changed files with 401 additions and 98 deletions

14
app.js
View File

@ -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.
*/