Fix bug where cancelled service is not processed and sent to client due to no stops arrray being present.
Signed-off-by: Fred Boniface <fred@fjla.uk>
This commit is contained in:
parent
f4b5e9ce37
commit
1f0a39adc6
@ -38,6 +38,7 @@ export async function findByHeadcode(
|
||||
scheduleEndDate: { $gte: searchDate },
|
||||
daysRun: { $in: [shortDay] },
|
||||
};
|
||||
console.log(JSON.stringify(query))
|
||||
const pipeline = getFindByHeadcodePipeline(query);
|
||||
|
||||
const result: SimpleService[] = (await queryAggregate(
|
||||
|
@ -36,6 +36,14 @@ export function formatTimetableDetail(
|
||||
}
|
||||
|
||||
function formatStops(stops: Stop[]): OB_TrainTT_stopDetail[] {
|
||||
if (!stops) {
|
||||
return []
|
||||
}
|
||||
|
||||
if (!stops.length) {
|
||||
return []
|
||||
}
|
||||
|
||||
// Cleanly coerce Stop[] to OB_TrainTT_stopDetail[]
|
||||
const formattedStops: OB_TrainTT_stopDetail[] = [];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user