diff --git a/src/app/degree-planner/degree-planner.component.ts b/src/app/degree-planner/degree-planner.component.ts index c182c2c53f01e4689d483056125e070230d666a9..c3acbd4c62fdaba89a58a9f02582ea34079ab449 100644 --- a/src/app/degree-planner/degree-planner.component.ts +++ b/src/app/degree-planner/degree-planner.component.ts @@ -59,7 +59,7 @@ export class DegreePlannerComponent { } // Overwrite the default term with the current term - this.termsByAcademicYear[year].terms[termCode] = {...term, courses: []}; + this.termsByAcademicYear[year].terms[termCode] = { ...term, courses: [] }; }); @@ -70,13 +70,12 @@ export class DegreePlannerComponent { } updateCourses() { - for (const term of this.degreePlanCourses) { - // console.log(term); - const yearCode = term.termCode.substring(0, 3); - const termCode = term.termCode.substring(3); + for (const course of this.degreePlanCourses) { + const yearCode = course.termCode.substring(0, 3); + const termCode = course.termCode.substring(3); if (this.termsByAcademicYear[yearCode] && this.termsByAcademicYear[yearCode].terms[termCode]) { - this.termsByAcademicYear[yearCode].terms[termCode].courses = term.courses; + this.termsByAcademicYear[yearCode].terms[termCode].courses.push(course); } } }