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, user,
body: { currentChallengeId } body: { currentChallengeId }
} = req; } = req;
return user return user.updateAttribute(
.update$({ currentChallengeId }) 'currentChallengeId',
.subscribe(() => res.status(200), next); currentChallengeId,
(err, updatedUser) => {
if (err) {
return next(err);
}
const { currentChallengeId } = updatedUser;
return res.status(200).json(currentChallengeId);
}
);
} }
const updateMyThemeValidators = [ const updateMyThemeValidators = [

View File

@ -33,10 +33,12 @@ const propTypes = {
completedDate: PropTypes.number, completedDate: PropTypes.number,
challengeType: PropTypes.number, challengeType: PropTypes.number,
solution: PropTypes.string, solution: PropTypes.string,
files: PropTypes.shape({ files: PropTypes.arrayOf(
PropTypes.shape({
ext: PropTypes.string, ext: PropTypes.string,
contents: PropTypes.string contents: PropTypes.string
}) })
)
}) })
), ),
fetchIdToNameMap: PropTypes.func.isRequired, fetchIdToNameMap: PropTypes.func.isRequired,