fix: code teruggezet die veroorzaakt werd door bug in backend/src/entities
This commit is contained in:
parent
55387066f0
commit
123fdf0fa1
1 changed files with 1 additions and 8 deletions
|
@ -30,14 +30,7 @@ async function fetchStudentClasses(username: string): Promise<Class[]> {
|
||||||
if (!student) return [];
|
if (!student) return [];
|
||||||
|
|
||||||
const classRepository = getClassRepository();
|
const classRepository = getClassRepository();
|
||||||
// a weird error when running npm run dev occurs when using .findByStudent
|
const classes = await classRepository.findByStudent(student);
|
||||||
// the error says that the function could not be found which is weird
|
|
||||||
// because typescript does not throw any errors
|
|
||||||
const classes = await classRepository.find(
|
|
||||||
{ students: student },
|
|
||||||
{ populate: ["students", "teachers"] } // voegt student en teacher objecten toe
|
|
||||||
)
|
|
||||||
// const classes = await classRepository.findByStudent(student);
|
|
||||||
|
|
||||||
if (!classes) return [];
|
if (!classes) return [];
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue