db-vendo-client
Version:
Client for bahn.de public transport APIs.
22 lines (19 loc) • 456 B
JavaScript
const formatNearbyReq = (ctx, location) => {
const {profile, opt} = ctx;
return {
endpoint: profile.nearbyEndpoint,
query: {
long: location.longitude,
lat: location.latitude,
radius: opt.distance || undefined,
products: profile.formatProductsFilter(ctx, opt.products || {}),
// TODO getPOIs: Boolean(opt.poi),
// TODO getStops: Boolean(opt.stops),
maxNo: opt.results,
},
method: 'get',
};
};
export {
formatNearbyReq,
};