fix: getting of fallback issued date for fullstack certificate (#43977)

This commit is contained in:
AndreiD049
2021-11-25 08:37:34 +02:00
committed by GitHub
parent ed29836204
commit 67d0061aa1
2 changed files with 13 additions and 6 deletions

View File

@@ -58,8 +58,15 @@ export default function bootCertificate(app) {
app.use(api);
}
export function getFallbackFrontEndDate(completedChallenges, completedDate) {
var chalIds = [...Object.values(certTypeIdMap), oldDataVizId];
export function getFallbackFullStackDate(completedChallenges, completedDate) {
var chalIds = [
certTypeIdMap[certTypes.respWebDesign],
certTypeIdMap[certTypes.jsAlgoDataStruct],
certTypeIdMap[certTypes.frontEndDevLibsId],
certTypeIdMap[certTypes.dataVis2018],
certTypeIdMap[certTypes.apisMicroservicesId],
certTypeIdMap[certTypes.legacyInfosecQaId]
];
const latestCertDate = completedChallenges
.filter(chal => chalIds.includes(chal.id))
@@ -463,7 +470,7 @@ function createShowCert(app) {
// if fullcert is not found, return the latest completedDate
if (certType === 'isFullStackCert' && !certChallenge) {
completedDate = getFallbackFrontEndDate(
completedDate = getFallbackFullStackDate(
completedChallenges,
completedDate
);