update copy of certificate flows

This commit is contained in:
Quincy Larson
2015-10-05 17:18:35 -07:00
parent fc17e266fb
commit 34efc43f6a
4 changed files with 49 additions and 15 deletions

View File

@@ -91,8 +91,16 @@ export default function certificate(app) {
debug('certified');
if (isFront) {
user.isFrontEndCert = true;
user.completedChallenges.push({
completedDate: new Date(),
id: frontEndChallangeId
})
} else {
user.isFullStackCert = true;
user.completedChallenges.push({
completedDate: new Date(),
id: fullStackChallangeId
})
}
return saveUser(user);
}

View File

@@ -275,7 +275,9 @@ module.exports = function(app) {
!showFront && user.isFullStackCert
) {
var { completedDate } = _.find(user.completedChallenges, {
id: '561add10cb82ac38a17513be'
id: showFront ?
'561add10cb82ac38a17513be' :
'660add10cb82ac38a17513be'
});
return res.render(