mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 07:09:35 +02:00
DB: use ver 1.16 for stop() requests 🐛, update integration test fixture ✅
fixes #288
This commit is contained in:
parent
9d35d83c97
commit
8faf8ba507
2 changed files with 150 additions and 136 deletions
|
@ -33,6 +33,19 @@ const transformReqBody = (ctx, body) => {
|
||||||
return body
|
return body
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const transformReq = (ctx, req) => {
|
||||||
|
const body = JSON.parse(req.body)
|
||||||
|
// stop() a.k.a. LocDetails seems broken with ver >1.16, all other methods work
|
||||||
|
if (body.svcReqL[0].meth === 'LocDetails') {
|
||||||
|
req.body = JSON.stringify({
|
||||||
|
...body,
|
||||||
|
ver: '1.16',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return req
|
||||||
|
}
|
||||||
|
|
||||||
const slices = (n, arr) => {
|
const slices = (n, arr) => {
|
||||||
const initialState = {slices: [], count: Infinity}
|
const initialState = {slices: [], count: Infinity}
|
||||||
return arr.reduce(({slices, count}, item) => {
|
return arr.reduce(({slices, count}, item) => {
|
||||||
|
@ -493,6 +506,7 @@ const profile = {
|
||||||
addChecksum: true,
|
addChecksum: true,
|
||||||
|
|
||||||
transformReqBody,
|
transformReqBody,
|
||||||
|
transformReq,
|
||||||
transformJourneysQuery,
|
transformJourneysQuery,
|
||||||
|
|
||||||
products: products,
|
products: products,
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Add table
Reference in a new issue