allow value -1 for transfers option in journeys() for db and dbnav profiles

This commit is contained in:
dabund24 2025-01-08 21:08:14 +01:00
parent 9e69594a36
commit 7147c51b28
2 changed files with 2 additions and 2 deletions

View file

@ -7,7 +7,7 @@ const formatJourneysReq = (ctx, from, to, when, outFrwd, journeysRef) => {
// TODO opt.accessibility
// TODO routingMode
let query = {
maxUmstiege: opt.transfers,
maxUmstiege: opt.transfers === -1 ? undefined : opt.transfers, // setting `maxUmstiege` to -1 is not allowed, see https://github.com/public-transport/db-vendo-client/issues/5
minUmstiegszeit: opt.transferTime,
deutschlandTicketVorhanden: false,
nurDeutschlandTicketVerbindungen: false,

View file

@ -46,7 +46,7 @@ const formatJourneysReq = (ctx, from, to, when, outFrwd, journeysRef) => {
? [{locationId: profile.formatLocation(profile, opt.via, 'opt.via').lid}]
: undefined,
zielLocationId: to.lid,
maxUmstiege: opt.transfers || undefined,
maxUmstiege: opt.transfers === -1 ? undefined : opt.transfers, // setting `maxUmstiege` to -1 is not allowed, see https://github.com/public-transport/db-vendo-client/issues/5
minUmstiegsdauer: opt.transferTime || undefined,
fahrradmitnahme: opt.bike,
},