From 6068b967b1f2f9e35fc30866058c429564333dfa Mon Sep 17 00:00:00 2001 From: miles-grant-ibigroup Date: Thu, 30 Oct 2025 11:15:17 -0400 Subject: [PATCH] fix: Support OTP2 `via` --- packages/core-utils/src/query-params.jsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/core-utils/src/query-params.jsx b/packages/core-utils/src/query-params.jsx index ce221eee5..be8233d03 100644 --- a/packages/core-utils/src/query-params.jsx +++ b/packages/core-utils/src/query-params.jsx @@ -640,10 +640,23 @@ const queryParams = [ name: "intermediatePlaces", default: [], routingTypes: ["ITINERARY"], + // Translate OTP1 intermediatePlaces to OTP2 via + // Requires stop id to be present + // TODO: When does this fire? why does it lag behind one request? itineraryRewrite: places => Array.isArray(places) && places.length > 0 ? { - intermediatePlaces: places.map(place => formatPlace(place)) + via: { + passThrough: { + stopLocationIds: places.map( + place => + // TODO: Don't hardcode + `TriMet:${ + place.rawGeocodedFeature.properties.id.split("::")[0] + }` + ) + } + } } : undefined },