Skip to content

Commit

Permalink
Merge pull request #74 from shikshalokam/master
Browse files Browse the repository at this point in the history
 criteria fix
  • Loading branch information
aks30 authored Feb 22, 2022
2 parents 4b5ac20 + f4a1f8b commit ec56745
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions module/solutions/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -1064,6 +1064,20 @@ module.exports = class SolutionsHelper {
}

updateThemes(newSolutionDocument.themes);
// Replace criteria ids in flattend themes key
if ( newSolutionDocument["flattenedThemes"] && Array.isArray( newSolutionDocument["flattenedThemes"]) && newSolutionDocument["flattenedThemes"].length>0) {
for (let pointerToFlattenedThemesArray = 0; pointerToFlattenedThemesArray < newSolutionDocument["flattenedThemes"].length; pointerToFlattenedThemesArray++) {
let theme = newSolutionDocument["flattenedThemes"][pointerToFlattenedThemesArray];
if(theme.criteria && Array.isArray(theme.criteria) && theme.criteria.length >0) {
for (let pointerToThemeCriteriaArray = 0; pointerToThemeCriteriaArray < theme.criteria.length; pointerToThemeCriteriaArray++) {
let criteria = theme.criteria[pointerToThemeCriteriaArray];
if(criteriaIdMap[criteria.criteriaId.toString()]) {
newSolutionDocument["flattenedThemes"][pointerToFlattenedThemesArray].criteria[pointerToThemeCriteriaArray].criteriaId = criteriaIdMap[criteria.criteriaId.toString()];
}
}
}
}
}

let startDate = new Date();
let endDate = new Date();
Expand Down

0 comments on commit ec56745

Please sign in to comment.