From e648aeaea534f103954ecaaf475e1a136e87a97e Mon Sep 17 00:00:00 2001 From: andrei Date: Sat, 5 Oct 2024 19:28:49 +0500 Subject: [PATCH] ._. --- src/pages/DeliveryOrderDetails.jsx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/pages/DeliveryOrderDetails.jsx b/src/pages/DeliveryOrderDetails.jsx index 2bd86ec..c3e6790 100644 --- a/src/pages/DeliveryOrderDetails.jsx +++ b/src/pages/DeliveryOrderDetails.jsx @@ -36,9 +36,18 @@ const DeliveryOrderDetails = () => { setDeliveryAccessories(accessories); const coords = await Promise.all( - accessories.map(async (accessory) => { - const coords = await getCoordinates(accessory.city_name); - return { city: accessory.city_name, ...coords }; + accessories.map(async (accessory) => { + console.log(accessory); + if (accessory.latitude && accessory.longitude) { + return { + city: accessory.city_name, + latitude: accessory.latitude, + longitude: accessory.longitude, + }; + } else { + const coords = await getCoordinates(accessory.city_name); + return { city: accessory.city_name, ...coords }; + } }) ); setCoordinates(coords);