fix: Rework reset progress saga to wait for the updated user

This commit is contained in:
Bouncey
2019-02-26 23:39:51 +00:00
committed by Valeriy
parent d3418dfecf
commit 9151723951
3 changed files with 16 additions and 21 deletions

View File

@ -152,13 +152,9 @@ function getUnlinkSocial(req, res, next) {
function postResetProgress(req, res, next) {
const { user } = req;
user.updateAttributes(
return user.updateAttributes(
{
progressTimestamps: [
{
timestamp: Date.now()
}
],
progressTimestamps: [Date.now()],
currentChallengeId: '',
isRespWebDesignCert: false,
is2018DataVisCert: false,
@ -177,10 +173,7 @@ function postResetProgress(req, res, next) {
if (err) {
return next(err);
}
return res.status(200).json({
messageType: 'success',
message: 'You have successfully reset your progress'
});
return res.sendStatus(200);
}
);
}