journeys: don't request nr of results by default 💥

This commit is contained in:
Jannis R 2018-10-29 18:36:11 +01:00
parent 272bf64e5e
commit baff692b70
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5
2 changed files with 3 additions and 3 deletions

View file

@ -48,7 +48,7 @@ With `opt`, you can override the default options, which look like this:
earlierThan: null, // ref to get journeys earlier than the last query
laterThan: null, // ref to get journeys later than the last query
results: 5, // how many journeys?
results: null, // number of journeys  `null` means "whatever HAFAS returns"
via: null, // let journeys pass this station
stopovers: false, // return stations on the way?
transfers: -1, // Maximum nr of transfers. Default: Let HAFAS decide.

View file

@ -133,7 +133,7 @@ const createClient = (profile, userAgent, request = _request) => {
}
opt = Object.assign({
results: 5, // how many journeys?
results: null, // number of journeys  `null` means "whatever HAFAS returns"
via: null, // let journeys pass this station?
stopovers: false, // return stations on the way?
transfers: -1, // maximum of 5 transfers
@ -208,7 +208,7 @@ const createClient = (profile, userAgent, request = _request) => {
getPolyline: !!opt.polylines
// todo: `getConGroups: false` what is this?
}
if (profile.journeysNumF) query.numF = opt.results
if (profile.journeysNumF && opt.results !== null) query.numF = opt.results
if (profile.journeysOutFrwd) query.outFrwd = outFrwd
return request(profile, userAgent, opt, {