Skip to content

Commit

Permalink
fix(apiV2): Don't perform query and UI changes on invalid mode select…
Browse files Browse the repository at this point in the history
…ion.
  • Loading branch information
binh-dam-ibigroup committed May 24, 2024
1 parent 61b6795 commit 0be3161
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/actions/apiV2.js
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,10 @@ export function routingQuery(searchId = null, updateSearchInReducer) {
// This is likely due to the fact that BICYCLE_RENT is treated as a transit submode.
const combinations = modes ? [baseQuery] : generateCombinations(baseQuery)

if (combinations.length === 0) {
return RoutingQueryCallResult.INVALID_MODE_SELECTION
}

dispatch(
routingRequest({
activeItinerary,
Expand Down Expand Up @@ -1171,9 +1175,7 @@ export function routingQuery(searchId = null, updateSearchInReducer) {
dispatch(updateOtpUrlParams(state, searchId))
}

return combinations.length === 0
? RoutingQueryCallResult.INVALID_MODE_SELECTION
: RoutingQueryCallResult.SUCCESS
return RoutingQueryCallResult.SUCCESS
}
}

Expand Down

0 comments on commit 0be3161

Please sign in to comment.