aboutsummaryrefslogtreecommitdiff
path: root/src/models/Lab.ts
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2022-07-30 17:21:29 -0500
committerFurkan Sahin <furkan-dev@proton.me>2022-07-30 17:21:29 -0500
commita19894369bc759c31cde45493f1c41548c0e55d8 (patch)
tree6cec8f874ad838e864aaacafae2bd235684c3cbd /src/models/Lab.ts
parent09bbabb765d9e8c64b9455394295b5732622d3c3 (diff)
parsing labs for faculty information, begin displaying lab's faculuty information (in Labs page for example)
Diffstat (limited to 'src/models/Lab.ts')
-rw-r--r--src/models/Lab.ts23
1 files changed, 19 insertions, 4 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() {