db-vendo-client/format/nearby-req.js
2024-12-08 21:42:57 +00:00

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,
};