feat: add upcoming colles
This commit is contained in:
parent
cc817cf9a7
commit
f8d698685f
1 changed files with 13 additions and 0 deletions
|
|
@ -106,6 +106,18 @@ export class ColleService {
|
|||
|
||||
const studentColles = await studentCollesQuery
|
||||
|
||||
const now = DateTime.now()
|
||||
const upcomingClassColles = await Colle.query()
|
||||
.whereHas('student', (query) => {
|
||||
query.where('className', student.className)
|
||||
})
|
||||
.where('date', '>=', now.toISODate()!)
|
||||
.orderBy('date', 'asc')
|
||||
.preload('student')
|
||||
.preload('examiner')
|
||||
.preload('subject')
|
||||
.preload('room')
|
||||
|
||||
// TODO: Favorite colles
|
||||
const favoriteColles = [] as Colle[]
|
||||
|
||||
|
|
@ -113,6 +125,7 @@ export class ColleService {
|
|||
classColles,
|
||||
studentColles,
|
||||
favoriteColles,
|
||||
upcomingClassColles,
|
||||
healthyUntil: await this.getHealthyUntil(student.className),
|
||||
lastSync: await this.getLastSync(student.className),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue