mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 07:09:35 +02:00
bugfixes :bug
This commit is contained in:
parent
126bc316f0
commit
66dfc73259
1 changed files with 4 additions and 4 deletions
8
index.js
8
index.js
|
@ -9,9 +9,9 @@ const onData = (d) => {
|
||||||
if (!d.common) return d
|
if (!d.common) return d
|
||||||
const c = d.common
|
const c = d.common
|
||||||
if (Array.isArray(c.locL)) d.locations = c.locL.map(parse.location)
|
if (Array.isArray(c.locL)) d.locations = c.locL.map(parse.location)
|
||||||
if (Array.isArray(c.prodL)) d.locations = c.prodL.map(parse.product)
|
if (Array.isArray(c.prodL)) d.products = c.prodL.map(parse.product)
|
||||||
if (Array.isArray(c.remL)) d.locations = c.remL.map(parse.remark)
|
if (Array.isArray(c.remL)) d.remarks = c.remL.map(parse.remark)
|
||||||
if (Array.isArray(c.opL)) d.locations = c.opL.map(parse.agency)
|
if (Array.isArray(c.opL)) d.agencies = c.opL.map(parse.agency)
|
||||||
return d
|
return d
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ const request = (cfg) => (data) => {
|
||||||
'Accept-Encoding': 'gzip, deflate'
|
'Accept-Encoding': 'gzip, deflate'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (cfg.req) req = cfg.req(req)
|
if (cfg.onReq) req = cfg.onReq(req)
|
||||||
|
|
||||||
return got.post(cfg.endpoint, req)
|
return got.post(cfg.endpoint, req)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
|
Loading…
Add table
Reference in a new issue