[O] Parse courseIDs

This commit is contained in:
Hykilpikonna
2020-04-12 16:19:52 -04:00
parent 3f48a97668
commit 70a46c0782
+3 -3
View File
@@ -6,7 +6,7 @@ export default class CourseInfo
name: string name: string
teacher: string teacher: string
level: string level: string
courseIds: string courseIds: number[]
uniqueName: string uniqueName: string
courseCount: number courseCount: number
@@ -24,10 +24,10 @@ export default class CourseInfo
this.name = json.name.trim() this.name = json.name.trim()
this.teacher = json.teacher this.teacher = json.teacher
this.level = json.level 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.uniqueName = this.name.replace(/( A| CP| H)$/g, '')
this.courseCount = this.courseIds.split('|').length; this.courseCount = this.courseIds.length;
this.gradeLevels = []; this.gradeLevels = [];
} }
} }