aboutsummaryrefslogtreecommitdiff
path: root/src/student-prod.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/student-prod.ts')
-rw-r--r--src/student-prod.ts16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/student-prod.ts b/src/student-prod.ts
index 5a1673e..90398c9 100644
--- a/src/student-prod.ts
+++ b/src/student-prod.ts
@@ -50,15 +50,12 @@ async function _fetchStudents() {
}
const id = match[1];
- const groupCell = row.querySelector(".c5")!;
- const group = groupCell.querySelector<HTMLElement>("a.quickeditlink")!.textContent;
-
- fetchedStudents.push(new Student(Number(id), name, group));
+ fetchedStudents.push(new Student(Number(id), name));
});
return fetchedStudents;
}
-async function fetchStudents(idFilter?: number, nameFilter?: string, groupFilter?: string) {
+async function fetchStudents(idFilter?: number, nameFilter?: string) {
if (students === null) {
const studentsPromise = _fetchStudents();
const storedStudents = localStorage.getItem("students");
@@ -66,7 +63,7 @@ async function fetchStudents(idFilter?: number, nameFilter?: string, groupFilter
studentsPromise.then((fetched) => localStorage.setItem("students", JSON.stringify(fetched)));
students = [];
for (const o of JSON.parse(storedStudents)) {
- students.push(new Student(o.id, o.name, o.group));
+ students.push(new Student(o.id, o.name));
}
} else {
students = await studentsPromise;
@@ -77,13 +74,12 @@ async function fetchStudents(idFilter?: number, nameFilter?: string, groupFilter
return students.filter(
(s) =>
(typeof idFilter === "undefined" || s.id === idFilter) &&
- (typeof nameFilter === "undefined" || s.name.includes(nameFilter)) &&
- (typeof groupFilter === "undefined" || s.group.includes(groupFilter)),
+ (typeof nameFilter === "undefined" || s.name.includes(nameFilter))
);
}
-async function fetchStudent(idFilter?: number, nameFilter?: string, groupFilter?: string) {
- const students = await fetchStudents(idFilter, nameFilter, groupFilter);
+async function fetchStudent(idFilter?: number, nameFilter?: string) {
+ const students = await fetchStudents(idFilter, nameFilter);
return students[0];
}