._.
This commit is contained in:
parent
514b773a90
commit
e648aeaea5
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user