Filter ungraded colles to avoid unexecepted behaviors

This commit is contained in:
Nathan 2025-09-30 18:19:14 +02:00
parent 796c568834
commit bf8c8d2e8a

View file

@ -44,6 +44,7 @@ export class GradeService {
.where('studentId', userId) .where('studentId', userId)
.where('date', '>=', startDate.toJSDate()) .where('date', '>=', startDate.toJSDate())
.where('date', '<', endDate.toJSDate()) .where('date', '<', endDate.toJSDate())
.whereNotNull('garde')
.preload('subject') .preload('subject')
.orderBy('date', 'asc') .orderBy('date', 'asc')
} }
@ -53,6 +54,7 @@ export class GradeService {
.where('studentId', userId) .where('studentId', userId)
.where('subjectId', subjectId) .where('subjectId', subjectId)
.where('date', '<', beforeDate.toJSDate()) .where('date', '<', beforeDate.toJSDate())
.whereNotNull('garde')
return colles.length ? this.calculateAverage(colles) : 0 return colles.length ? this.calculateAverage(colles) : 0
} }