mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-04-20 23:23:56 +03:00
24 lines
556 B
JavaScript
24 lines
556 B
JavaScript
|
const formatStationBoardReq = (ctx, station, type) => {
|
||
|
const {profile, opt} = ctx;
|
||
|
|
||
|
const maxVias = opt.vias ?? 0;
|
||
|
|
||
|
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: maxVias !== 0 ? true : undefined,
|
||
|
maxVias,
|
||
|
verkehrsmittel: profile.formatProductsFilter(ctx, opt.products || {}),
|
||
|
},
|
||
|
method: 'GET',
|
||
|
};
|
||
|
};
|
||
|
|
||
|
export {
|
||
|
formatStationBoardReq,
|
||
|
};
|