fix several busg with tasks and challenges

This commit is contained in:
Matteo Pagliazzi
2016-01-15 18:54:28 +01:00
parent 3eb9d4b098
commit b0caf71641
2 changed files with 11 additions and 5 deletions

View File

@@ -92,7 +92,7 @@ api.createChallengeTasks = {
let reqValidationErrors = req.validationErrors();
if (reqValidationErrors) throw reqValidationErrors;
let user = res.local.user;
let user = res.locals.user;
let challengeId = req.params.challengeId;
let challenge = await Challenge.findOne({_id: challengeId}).exec();
@@ -194,7 +194,7 @@ api.getChallengeTasks = {
let validationErrors = req.validationErrors();
if (validationErrors) throw validationErrors;
let user = res.local.user;
let user = res.locals.user;
let challengeId = req.params.challengeId;
let challenge = await Challenge.findOne({_id: challengeId}).select('leader').exec();