fix: Update some apis/datastructures
This commit is contained in:
committed by
mrugesh mohapatra
parent
aca424be97
commit
f5ae5027cc
@ -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 = [
|
||||||
|
@ -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(
|
||||||
ext: PropTypes.string,
|
PropTypes.shape({
|
||||||
contents: PropTypes.string
|
ext: PropTypes.string,
|
||||||
})
|
contents: PropTypes.string
|
||||||
|
})
|
||||||
|
)
|
||||||
})
|
})
|
||||||
),
|
),
|
||||||
fetchIdToNameMap: PropTypes.func.isRequired,
|
fetchIdToNameMap: PropTypes.func.isRequired,
|
||||||
|
Reference in New Issue
Block a user