Merge pull request #3646 from FreeCodeCamp/fix/certificate

Fix check for _id as well as id during certification
pull/3647/head
Quincy Larson 2015-10-07 18:13:42 -07:00
commit 0dfa70c15b
1 changed files with 5 additions and 1 deletions

View File

@ -31,7 +31,11 @@ function isCertified(frontEndIds, { completedChallenges, isFrontEndCert }) {
if (isFrontEndCert) {
return true;
}
return _.every(frontEndIds, ({ id }) => _.some(completedChallenges, { id }));
return _.every(frontEndIds, ({ id }) => {
return _.some(completedChallenges, (challenge) => {
return challenge.id === id || challenge._id === id;
});
});
}
export default function certificate(app) {