Merge remote-tracking branch 'origin/dev' into feat/user-routes

# Conflicts:
#	backend/src/controllers/students.ts
#	backend/src/controllers/teachers.ts
#	backend/src/data/classes/class-join-request-repository.ts
#	backend/src/routes/students.ts
#	backend/src/services/students.ts
#	backend/src/services/teachers.ts
#	backend/tests/test_assets/users/students.testdata.ts
#	frontend/src/controllers/controllers.ts
#	frontend/src/queries/themes.ts
This commit is contained in:
Gabriellvl 2025-04-01 18:12:15 +02:00
commit 7f189188e8
139 changed files with 3594 additions and 3063 deletions

View file

@ -36,11 +36,15 @@ export async function getAllClasses(full: boolean): Promise<ClassDTO[] | string[
export async function createClass(classData: ClassDTO): Promise<ClassDTO | null> {
const teacherRepository = getTeacherRepository();
const teacherUsernames = classData.teachers || [];
const teachers = (await Promise.all(teacherUsernames.map((id) => teacherRepository.findByUsername(id)))).filter((teacher) => teacher !== null);
const teachers = (await Promise.all(teacherUsernames.map(async (id) => teacherRepository.findByUsername(id)))).filter(
(teacher) => teacher !== null
);
const studentRepository = getStudentRepository();
const studentUsernames = classData.students || [];
const students = (await Promise.all(studentUsernames.map((id) => studentRepository.findByUsername(id)))).filter((student) => student !== null);
const students = (await Promise.all(studentUsernames.map(async (id) => studentRepository.findByUsername(id)))).filter(
(student) => student !== null
);
const classRepository = getClassRepository();