adapt docs to 005f3f8 📝

This commit is contained in:
Jannis R 2018-03-23 21:19:25 +01:00
parent fe8f9c29f9
commit 2430a74414
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5

View file

@ -187,24 +187,7 @@ The response may look like this:
arrival: '2017-12-17T19:17:00.000+01:00', arrival: '2017-12-17T19:17:00.000+01:00',
departure: '2017-12-17T19:17:00.000+01:00' departure: '2017-12-17T19:17:00.000+01:00'
} ] } ]
} ], } ]
origin: {
type: 'station',
id: '900000003201',
name: 'S+U Berlin Hauptbahnhof',
location: { /* … */ },
products: { /* … */ }
},
departure: '2017-12-17T19:07:00.000+01:00',
destination: {
type: 'station',
id: '900000024101',
name: 'S Charlottenburg',
location: { /* … */ },
products: { /* … */ }
},
arrival: '2017-12-17T19:47:00.000+01:00',
arrivalDelay: 30
}, },
earlierRef: '…', // use with the `earlierThan` option earlierRef: '…', // use with the `earlierThan` option
laterRef: '…' // use with the `laterThan` option laterRef: '…' // use with the `laterThan` option
@ -259,16 +242,16 @@ const heinrichHeineStr = '900000100008'
client.journeys(hbf, heinrichHeineStr) client.journeys(hbf, heinrichHeineStr)
.then((journeys) => { .then((journeys) => {
const lastJourney = journeys[journeys.length - 1] const lastJourney = journeys[journeys.length - 1]
console.log('departure of last journey', lastJourney.departure) console.log('departure of last journey', lastJourney.legs[0].departure)
// get later journeys // get later journeys
return client.journeys(hbf, heinrichHeineStr, { return client.journeys(hbf, heinrichHeineStr, {
laterThan: journeys.laterRef laterThan: journeys.laterRef
}) })
}) })
.then((laterourneys) => { .then((laterJourneys) => {
const firstJourney = laterourneys[laterourneys.length - 1] const firstJourney = laterourneys[laterJourneys.length - 1]
console.log('departure of first (later) journey', firstJourney.departure) console.log('departure of first (later) journey', firstJourney.legs[0].departure)
}) })
.catch(console.error) .catch(console.error)
``` ```