2022-05-07 16:17:37 +02:00
|
|
|
const formatNearbyReq = (ctx, location) => {
|
2024-02-06 22:58:49 +01:00
|
|
|
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',
|
2024-02-06 22:58:49 +01:00
|
|
|
};
|
|
|
|
};
|
2019-10-31 20:08:56 +01:00
|
|
|
|
2022-05-07 16:17:37 +02:00
|
|
|
export {
|
|
|
|
formatNearbyReq,
|
2024-02-06 22:58:49 +01:00
|
|
|
};
|