db-vendo-client/format/nearby-req.js
Kristjan ESPERANTO 66d9fb5194
apply linting rules
follow-up of 228c7253
2024-02-10 16:50:12 +01:00

28 lines
532 B
JavaScript

const formatNearbyReq = (ctx, location) => {
const {profile, opt} = ctx;
return {
cfg: {polyEnc: 'GPA'},
meth: 'LocGeoPos',
req: {
ring: {
cCrd: {
x: profile.formatCoord(location.longitude),
y: profile.formatCoord(location.latitude),
},
maxDist: opt.distance || -1,
minDist: 0,
},
locFltrL: [
profile.formatProductsFilter(ctx, opt.products || {}),
],
getPOIs: Boolean(opt.poi),
getStops: Boolean(opt.stops),
maxLoc: opt.results,
},
};
};
export {
formatNearbyReq,
};