fix: locatation refactor

This commit is contained in:
Mohamed Marrouchi 2024-12-19 14:49:53 +01:00
parent 3d974356d0
commit 71864ba7ce

View File

@ -139,9 +139,10 @@ export class ConversationService extends BaseService<
const msg = event.getMessage(); const msg = event.getMessage();
if (msgType === 'location' && 'coordinates' in msg) { if (msgType === 'location' && 'coordinates' in msg) {
const coordinates = msg.coordinates; const coordinates = msg.coordinates;
convo.context.user_location = { lat: 0, lon: 0 }; convo.context.user_location = {
convo.context.user_location.lat = parseFloat(coordinates.lat.toString()); lat: parseFloat(coordinates.lat.toString()),
convo.context.user_location.lon = parseFloat(coordinates.lon.toString()); lon: parseFloat(coordinates.lon.toString()),
};
} else if (msgType === 'attachments') { } else if (msgType === 'attachments') {
// @TODO : deprecated in favor of geolocation msgType // @TODO : deprecated in favor of geolocation msgType
const attachments = event.getAttachments(); const attachments = event.getAttachments();