mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-22 22:59:35 +02:00
21 lines
456 B
JavaScript
21 lines
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,
|
|
};
|