diff --git a/back/methods/quadminds-api-config/sendPois.js b/back/methods/quadminds-api-config/sendPois.js index af0cafcb3..933536eb1 100644 --- a/back/methods/quadminds-api-config/sendPois.js +++ b/back/methods/quadminds-api-config/sendPois.js @@ -34,6 +34,12 @@ module.exports = Self => { ) SELECT a.id code, c.socialName name, + IF(ABS(a.latitude - ROUND(a.latitude)) < 0.000001, NULL, a.latitude) latitude, + IF(ABS(a.longitude - ROUND(a.longitude)) < 0.000001, NULL, a.longitude) longitude, + a.street, + a.city locality, + p.name state, + co.name country, CONCAT_WS(', ', IFNULL(a.street, ''), IFNULL(a.city, ''), IFNULL(p.name, '')) longAddress, CONCAT(IFNULL(a.mobile, c.mobile)) phoneNumber, dn.description poiDeliveryComments, @@ -53,6 +59,14 @@ module.exports = Self => { return { ...poi, code: poi.code.toString(), + latitude: poi.latitude || undefined, + longitude: poi.longitude || undefined, + address: { + street: poi.street || undefined, + locality: poi.locality || undefined, + state: poi.state || undefined, + country: poi.country || undefined + }, poiDeliveryComments: poi.poiDeliveryComments || undefined, phoneNumber: poi.phoneNumber || undefined, email: poi.email || undefined