Add notes to findByHeadcode(headcode)

Signed-off-by: Fred Boniface <fred@fjla.uk>
This commit is contained in:
Fred Boniface 2023-05-31 20:40:34 +01:00
parent 085e6aa80d
commit e2cba37938

View File

@ -14,6 +14,8 @@ async function findByHeadcode(headcode) {
scheduleEndDate: {$gte: now}, scheduleEndDate: {$gte: now},
daysRun: {$in: [shortDay]} daysRun: {$in: [shortDay]}
}; };
// At this point, the returned objects need sorting to ensure the correct object is returned.
// C, N, O, P is the order - C being the preferred, then N, then O and finally P.
return db.query('timetable', query); return db.query('timetable', query);
} }