diff options
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 }; |
