Skip to content

Commit

Permalink
revert: three previous commits
Browse files Browse the repository at this point in the history
  • Loading branch information
Chicken committed Aug 14, 2024
1 parent f65559d commit bf7246c
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/lib/vr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,6 @@ const trainResponseSchema = z.array(
commercialStop: z.boolean().optional(),
stationShortCode: z.string(),
scheduledTime: z.string(),
cancelled: z.boolean(),
type: z.string(),
})
),
})
Expand All @@ -229,13 +227,7 @@ export async function getTrainOnDate(date: string, trainNumber: string) {

const auth = await getVrAuth();

train.timeTableRows = train.timeTableRows.filter(
(r, i, a) =>
r.trainStopping &&
r.commercialStop &&
!r.cancelled &&
(r.type === "DEPARTURE" && i > 0 ? !a[i - 1]?.cancelled : true)
);
train.timeTableRows = train.timeTableRows.filter((r) => r.trainStopping && r.commercialStop);

const newTrain = {
...train,
Expand Down

0 comments on commit bf7246c

Please sign in to comment.