From aa2e57d072303d4672e25861d02ba5088ef0b7d2 Mon Sep 17 00:00:00 2001 From: Scott Berg <saberg3@wisc.edu> Date: Fri, 16 Nov 2018 09:34:27 -0600 Subject: [PATCH] Update course map to work with the API updates. --- src/app/degree-planner/degree-planner.component.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/app/degree-planner/degree-planner.component.ts b/src/app/degree-planner/degree-planner.component.ts index c182c2c..c3acbd4 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); } } } -- GitLab