db-vendo-client/format/nearby-req.js

22 lines
456 B
JavaScript
Raw Normal View History

2022-05-07 16:17:37 +02:00
const formatNearbyReq = (ctx, location) => {
const {profile, opt} = ctx;
2019-10-31 20:08:56 +01:00
return {
2024-12-07 22:46:04 +00:00
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,
},
2024-12-08 21:42:57 +00:00
method: 'get',
};
};
2019-10-31 20:08:56 +01:00
2022-05-07 16:17:37 +02:00
export {
formatNearbyReq,
};