diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2026-08-05 11:51:51 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2026-08-05 11:51:51 +0200 |
| commit | 582df8885a3573a728394b473b826616f8969316 (patch) | |
| tree | 9c21db03f4fbfd9956ee398e0d9194ebfa5b3234 /src/student-mock.ts | |
| parent | 46ac53e11b49a7f9cdb92c3559b05f41ce90122f (diff) | |
| download | bycs-sol-582df8885a3573a728394b473b826616f8969316.tar.gz bycs-sol-582df8885a3573a728394b473b826616f8969316.zip | |
convert a lot of js to typescript and use a single graduation DB
Diffstat (limited to 'src/student-mock.ts')
| -rw-r--r-- | src/student-mock.ts | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/student-mock.ts b/src/student-mock.ts new file mode 100644 index 0000000..93b45b0 --- /dev/null +++ b/src/student-mock.ts @@ -0,0 +1,25 @@ +import type { Graduation } from "./graduation-common.ts"; +import { Student } from "./student-common.ts"; +import { fetchStudentsMock as fetchStudents, fetchGraduationMock } from "./mock.ts"; + +declare module "./student-common.ts" { + interface Student { + getGraduation(): Promise<Graduation>; + getIconUrl(): Promise<string>; + } +} +Student.prototype.getGraduation = function () { + return fetchGraduationMock(this); +}; + +Student.prototype.getIconUrl = async function () { + return ""; +}; + + +async function fetchStudent(_idFilter?: number, _nameFilter?: string, _groupFilter?: string) { + const students = await fetchStudents(); + return students[0]; +} + +export { Student, fetchStudents, fetchStudent }; |
