From 70a46c0782b896e61a28cbcac40a235fa940a155 Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Sun, 12 Apr 2020 16:19:52 -0400 Subject: [PATCH] [O] Parse courseIDs --- src/logic/course-info.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/logic/course-info.ts b/src/logic/course-info.ts index 67cff47..da28d12 100644 --- a/src/logic/course-info.ts +++ b/src/logic/course-info.ts @@ -6,7 +6,7 @@ export default class CourseInfo name: string teacher: string level: string - courseIds: string + courseIds: number[] uniqueName: string courseCount: number @@ -24,10 +24,10 @@ export default class CourseInfo this.name = json.name.trim() this.teacher = json.teacher this.level = json.level - this.courseIds = json.courseIds + this.courseIds = json.courseIds.split('|').map((id: string) => +id); this.uniqueName = this.name.replace(/( A| CP| H)$/g, '') - this.courseCount = this.courseIds.split('|').length; + this.courseCount = this.courseIds.length; this.gradeLevels = []; } }