diff options
Diffstat (limited to 'src/models')
| -rw-r--r-- | src/models/Lab.ts | 23 | ||||
| -rw-r--r-- | src/models/PeerTeacher.ts | 2 |
2 files changed, 20 insertions, 5 deletions
diff --git a/src/models/Lab.ts b/src/models/Lab.ts index 875bc7d..c3e21bb 100644 --- a/src/models/Lab.ts +++ b/src/models/Lab.ts @@ -11,7 +11,14 @@ interface LabSerializeInfo { }, building: string, room: string, - assigned: boolean + assigned: boolean, + faculty: { + bannerId: string, + courseReferenceNumber: string, + displayName: string, + emailAddress: string, + + }[] } export default class Lab { @@ -22,8 +29,15 @@ export default class Lab { building: string; room: string; assigned: boolean; + faculty: { + bannerId: string; + courseReferenceNumber: string; + displayName: string; + emailAddress: string; + + }[] - constructor(course: number | string, section: number | string, event: EventInfo, building = "", room = "", assigned = false) { + constructor(course: number | string, section: number | string, event: EventInfo, building = "", room = "", assigned = false, faculty = []) { if (typeof course === "string") { course = parseInt(course, 10); } @@ -38,10 +52,11 @@ export default class Lab { this.building = building; this.room = room; this.assigned = assigned; + this.faculty = faculty; } - static fromJSON({ course, section, event, building, room, assigned }: LabSerializeInfo) { - return new Lab(course, section, EventInfo.fromJSON(event), building, room, assigned); + static fromJSON({ course, section, event, building, room, assigned, faculty }: LabSerializeInfo) { + return new Lab(course, section, EventInfo.fromJSON(event), building, room, assigned, faculty); } get time() { diff --git a/src/models/PeerTeacher.ts b/src/models/PeerTeacher.ts index 5f9cf3c..c19fbd2 100644 --- a/src/models/PeerTeacher.ts +++ b/src/models/PeerTeacher.ts @@ -95,7 +95,7 @@ export default class PeerTeacher { let total_hours = 0; this.labs.forEach((lab_id) => { - total_hours += all_labs.get(lab_id)!.pay_hours; + total_hours += all_labs.get(lab_id)?.pay_hours; }) return total_hours; |
