mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 07:09:35 +02:00
adapt docs & examples to 96ff59d
📝
This commit is contained in:
parent
96ff59dc43
commit
0daa1c5fef
7 changed files with 8 additions and 8 deletions
|
@ -101,7 +101,7 @@ The response may look like this:
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
legs: [ {
|
legs: [ {
|
||||||
id: '1|32615|6|86|10072018',
|
tripId: '1|32615|6|86|10072018',
|
||||||
origin: {
|
origin: {
|
||||||
type: 'station',
|
type: 'station',
|
||||||
id: '900000003201',
|
id: '900000003201',
|
||||||
|
|
|
@ -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.
|
*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
|
```js
|
||||||
const createClient = require('hafas-client')
|
const createClient = require('hafas-client')
|
||||||
|
@ -16,7 +16,7 @@ const client = createClient(vbbProfile, 'my-awesome-program')
|
||||||
client.journeys('900000003201', '900000100008', {results: 1})
|
client.journeys('900000003201', '900000100008', {results: 1})
|
||||||
.then(([journey]) => {
|
.then(([journey]) => {
|
||||||
const leg = journey.legs[0]
|
const leg = journey.legs[0]
|
||||||
return client.trip(leg.id, leg.line.name)
|
return client.trip(leg.tripId, leg.line.name)
|
||||||
})
|
})
|
||||||
.then(console.log)
|
.then(console.log)
|
||||||
.catch(console.error)
|
.catch(console.error)
|
||||||
|
|
|
@ -34,7 +34,7 @@ client.journeys('900000003201', '900000024101', {results: 1, polylines: true})
|
||||||
|
|
||||||
// .then(([journey]) => {
|
// .then(([journey]) => {
|
||||||
// const leg = journey.legs[0]
|
// 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]) => {
|
// .then(([journey]) => {
|
||||||
|
|
|
@ -34,7 +34,7 @@ client.journeys('000002370', '000005919', {results: 1, polylines: true})
|
||||||
|
|
||||||
// .then(([journey]) => {
|
// .then(([journey]) => {
|
||||||
// const leg = journey.legs[0]
|
// 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]) => {
|
// .then(([journey]) => {
|
||||||
// return client.refreshJourney(journey.refreshToken, {stopovers: true, remarks: true})
|
// return client.refreshJourney(journey.refreshToken, {stopovers: true, remarks: true})
|
||||||
|
|
|
@ -26,7 +26,7 @@ client.journeys('008010226', '008013456', {results: 1})
|
||||||
|
|
||||||
// .then(([journey]) => {
|
// .then(([journey]) => {
|
||||||
// const leg = journey.legs[0]
|
// const leg = journey.legs[0]
|
||||||
// return client.trip(leg.id, leg.line.name)
|
// return client.trip(leg.tripId, leg.line.name)
|
||||||
// })
|
// })
|
||||||
|
|
||||||
// .then(([journey]) => {
|
// .then(([journey]) => {
|
||||||
|
|
|
@ -34,7 +34,7 @@ client.departures('8004154', {duration: 5})
|
||||||
|
|
||||||
// .then(([journey]) => {
|
// .then(([journey]) => {
|
||||||
// const leg = journey.legs.find(leg => leg.line)
|
// 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]) => {
|
// .then(([journey]) => {
|
||||||
|
|
|
@ -34,7 +34,7 @@ client.journeys('900000003201', '900000024101', {results: 1, polylines: true})
|
||||||
|
|
||||||
// .then(([journey]) => {
|
// .then(([journey]) => {
|
||||||
// const leg = journey.legs[0]
|
// 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]) => {
|
// .then(([journey]) => {
|
||||||
|
|
Loading…
Add table
Reference in a new issue