fix: Update some apis/datastructures

This commit is contained in:
Bouncey
2018-11-08 13:43:09 +00:00
committed by mrugesh mohapatra
parent aca424be97
commit f5ae5027cc
2 changed files with 17 additions and 7 deletions

View File

@ -104,9 +104,17 @@ function updateMyCurrentChallenge(req, res, next) {
user,
body: { currentChallengeId }
} = req;
return user
.update$({ currentChallengeId })
.subscribe(() => res.status(200), next);
return user.updateAttribute(
'currentChallengeId',
currentChallengeId,
(err, updatedUser) => {
if (err) {
return next(err);
}
const { currentChallengeId } = updatedUser;
return res.status(200).json(currentChallengeId);
}
);
}
const updateMyThemeValidators = [