[F] Fix enrollments not counting correctly

This commit is contained in:
Hykilpikonna
2020-04-19 16:28:37 -04:00
parent b8339a4e4c
commit 9b3d30959d
@@ -95,11 +95,17 @@
{ {
d.classes.split('|').forEach(classId => d.classes.split('|').forEach(classId =>
{ {
// Add grade level // Get info by class id
let info = this.courseInfo[this.courseIdIndex[+classId]]; let info = this.courseInfo[this.courseIdIndex[+classId]];
if (info as any != null && !info.gradeLevels.includes(d.gradeLevel)) if (info as any != null)
{ {
info.gradeLevels.push(d.gradeLevel); // Add grade level
if (!info.gradeLevels.includes(d.gradeLevel))
{
info.gradeLevels.push(d.gradeLevel);
}
// Count enrollments
info.enrollments ++; info.enrollments ++;
} }
}) })