mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 15:19:35 +02:00
17 lines
613 B
JavaScript
17 lines
613 B
JavaScript
import {getHeaders} from './header.js';
|
|
|
|
const formatStationBoardReq = (ctx, station, type) => {
|
|
const {profile, opt} = ctx;
|
|
|
|
return {
|
|
endpoint: profile.boardEndpoint,
|
|
path: type == 'departures' ? 'abfahrt' : 'ankunft',
|
|
body: {anfragezeit: profile.formatTimeOfDay(profile, opt.when), datum: profile.formatDate(profile, opt.when), ursprungsBahnhofId: profile.formatStation(station).lid, verkehrsmittel: profile.formatProductsFilter(ctx, opt.products || {}, 'dbnav')},
|
|
method: 'POST',
|
|
headers: getHeaders('application/x.db.vendo.mob.bahnhofstafeln.v2+json'),
|
|
};
|
|
};
|
|
|
|
export {
|
|
formatStationBoardReq,
|
|
};
|