Skip to content

Commit

Permalink
refactor(itinerary): Fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
binh-dam-ibigroup committed Sep 6, 2024
1 parent cf68453 commit d4ea7d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/util/itinerary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ export function applyRouteModeOverrides(
): void {
itinerary.legs.forEach((leg: LegWithOriginalMode) => {
// Use OTP2 leg route first, fallback on legacy leg routeId.
const routeId = leg.route?.id || leg.routeId
const routeId = typeof leg.route === 'object' ? leg.route.id : leg.routeId
if (routeId) {
leg.originalMode = leg.mode
leg.mode = checkForRouteModeOverride(
Expand All @@ -482,7 +482,7 @@ export function copyAndRemoveRouteModeOverrides(
): Itinerary {
return {
...itinerary,
legs: itinerary.legs.map((leg) => ({
legs: itinerary.legs.map((leg: LegWithOriginalMode) => ({
...leg,
mode: leg.originalMode || leg.mode
}))
Expand Down

0 comments on commit d4ea7d2

Please sign in to comment.