mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-22 22:59:35 +02:00
20 lines
531 B
JavaScript
20 lines
531 B
JavaScript
const formatStationBoardReq = (ctx, station, type) => {
|
|
const {profile, opt} = ctx;
|
|
|
|
return {
|
|
endpoint: profile.boardEndpoint,
|
|
path: type === 'departures' ? 'abfahrten' : 'ankuenfte',
|
|
query: {
|
|
ortExtId: station,
|
|
zeit: profile.formatTimeOfDay(profile, opt.when),
|
|
datum: profile.formatDate(profile, opt.when),
|
|
mitVias: opt.stopovers || Boolean(opt.direction) || undefined,
|
|
verkehrsmittel: profile.formatProductsFilter(ctx, opt.products || {}),
|
|
},
|
|
method: 'GET',
|
|
};
|
|
};
|
|
|
|
export {
|
|
formatStationBoardReq,
|
|
};
|