feat: questions via student

This commit is contained in:
Gabriellvl 2025-03-21 22:51:42 +01:00
parent 30ec73a88d
commit c31b471371
7 changed files with 153 additions and 171 deletions

View file

@ -54,4 +54,12 @@ export class QuestionRepository extends DwengoEntityRepository<Question> {
orderBy: { timestamp: 'ASC' },
});
}
public findAllByAuthor(author: Student): Promise<Question[]> {
return this.findAll({
where: { author },
orderBy: { timestamp: 'DESC' }, // new to old
});
}
}