mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 07:09:35 +02:00
fix requests with no filters
This commit is contained in:
parent
5814a69dd5
commit
b0eb6d6474
2 changed files with 4 additions and 3 deletions
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
const createFormatBitmask = (modes) => {
|
const createFormatBitmask = (modes) => {
|
||||||
const formatBitmask = (products) => {
|
const formatBitmask = (products) => {
|
||||||
|
if(Object.keys(products).length === 0) return null
|
||||||
let bitmask = 0
|
let bitmask = 0
|
||||||
for (let product in products) {
|
for (let product in products) {
|
||||||
if (products[product] === true) bitmask += modes[product].bitmask
|
if (products[product] === true) bitmask += modes[product].bitmask
|
||||||
|
|
6
index.js
6
index.js
|
@ -30,7 +30,7 @@ const createClient = (profile) => {
|
||||||
time: profile.formatTime(profile, opt.when),
|
time: profile.formatTime(profile, opt.when),
|
||||||
stbLoc: profile.formatStation(station),
|
stbLoc: profile.formatStation(station),
|
||||||
dirLoc: dir,
|
dirLoc: dir,
|
||||||
jnyFltrL: [products],
|
jnyFltrL: [products].filter(x => x !== null),
|
||||||
dur: opt.duration,
|
dur: opt.duration,
|
||||||
getPasslist: false
|
getPasslist: false
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@ const createClient = (profile) => {
|
||||||
|
|
||||||
const filters = [
|
const filters = [
|
||||||
profile.formatProducts(opt.products || {})
|
profile.formatProducts(opt.products || {})
|
||||||
]
|
].filter(x => x !== null)
|
||||||
if (
|
if (
|
||||||
opt.accessibility &&
|
opt.accessibility &&
|
||||||
profile.filters &&
|
profile.filters &&
|
||||||
|
@ -226,7 +226,7 @@ const createClient = (profile) => {
|
||||||
ageOfReport: true, // todo: what is this?
|
ageOfReport: true, // todo: what is this?
|
||||||
jnyFltrL: [
|
jnyFltrL: [
|
||||||
profile.formatProducts(opt.products || {})
|
profile.formatProducts(opt.products || {})
|
||||||
],
|
].filter(x => x !== null),
|
||||||
trainPosMode: 'CALC' // todo: what is this? what about realtime?
|
trainPosMode: 'CALC' // todo: what is this? what about realtime?
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Reference in a new issue