adapt docs & examples to 96ff59d 📝

This commit is contained in:
Jannis R 2018-11-21 23:56:39 +01:00
parent 96ff59dc43
commit 0daa1c5fef
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5
7 changed files with 8 additions and 8 deletions

View file

@ -101,7 +101,7 @@ The response may look like this:
[
{
legs: [ {
id: '1|32615|6|86|10072018',
tripId: '1|32615|6|86|10072018',
origin: {
type: 'station',
id: '900000003201',

View file

@ -4,7 +4,7 @@ This method can be used to refetch information about a trip  a vehicle stopp
*Note*: This method is not supported by every profile/endpoint.
Let's say you used [`journeys`](journeys.md) and now want to get more up-to-date data about the arrival/departure of a leg. You'd pass in the trip ID from `leg.id`, e.g. `'1|24983|22|86|18062017'`, and the name of the line from `leg.line.name` like this:
Let's say you used [`journeys`](journeys.md) and now want to get more up-to-date data about the arrival/departure of a leg. You'd pass in the trip ID from `leg.tripId`, e.g. `'1|24983|22|86|18062017'`, and the name of the line from `leg.line.name` like this:
```js
const createClient = require('hafas-client')
@ -16,7 +16,7 @@ const client = createClient(vbbProfile, 'my-awesome-program')
client.journeys('900000003201', '900000100008', {results: 1})
.then(([journey]) => {
const leg = journey.legs[0]
return client.trip(leg.id, leg.line.name)
return client.trip(leg.tripId, leg.line.name)
})
.then(console.log)
.catch(console.error)

View file

@ -34,7 +34,7 @@ client.journeys('900000003201', '900000024101', {results: 1, polylines: true})
// .then(([journey]) => {
// const leg = journey.legs[0]
// return client.trip(leg.id, leg.line.name, {polyline: true})
// return client.trip(leg.tripId, leg.line.name, {polyline: true})
// })
// .then(([journey]) => {

View file

@ -34,7 +34,7 @@ client.journeys('000002370', '000005919', {results: 1, polylines: true})
// .then(([journey]) => {
// const leg = journey.legs[0]
// return client.trip(leg.id, leg.line.name, {polyline: true})
// return client.trip(leg.tripId, leg.line.name, {polyline: true})
// })
// .then(([journey]) => {
// return client.refreshJourney(journey.refreshToken, {stopovers: true, remarks: true})

View file

@ -26,7 +26,7 @@ client.journeys('008010226', '008013456', {results: 1})
// .then(([journey]) => {
// const leg = journey.legs[0]
// return client.trip(leg.id, leg.line.name)
// return client.trip(leg.tripId, leg.line.name)
// })
// .then(([journey]) => {

View file

@ -34,7 +34,7 @@ client.departures('8004154', {duration: 5})
// .then(([journey]) => {
// const leg = journey.legs.find(leg => leg.line)
// return client.trip(leg.id, leg.line.name, {polyline: true})
// return client.trip(leg.tripId, leg.line.name, {polyline: true})
// })
// .then(([journey]) => {

View file

@ -34,7 +34,7 @@ client.journeys('900000003201', '900000024101', {results: 1, polylines: true})
// .then(([journey]) => {
// const leg = journey.legs[0]
// return client.trip(leg.id, leg.line.name, {polyline: true})
// return client.trip(leg.tripId, leg.line.name, {polyline: true})
// })
// .then(([journey]) => {