From cf2b3bf698944d23e289681fd86e9e3bcf97a9e9 Mon Sep 17 00:00:00 2001 From: Abhishek P Anil Date: Mon, 2 Sep 2024 15:16:25 +0530 Subject: [PATCH] fix: fixed lat and long not updated closes #1294 --- src/pages/Dashboard/CreateNewPlace/CreateNewPlace.jsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/pages/Dashboard/CreateNewPlace/CreateNewPlace.jsx b/src/pages/Dashboard/CreateNewPlace/CreateNewPlace.jsx index 67469012..d5ecfdac 100644 --- a/src/pages/Dashboard/CreateNewPlace/CreateNewPlace.jsx +++ b/src/pages/Dashboard/CreateNewPlace/CreateNewPlace.jsx @@ -435,6 +435,8 @@ function CreateNewPlace() { languageKey, dynamicFields, containedInPlaceObj, + latitude, + longitude, containsPlace = []; if (calendarContentLanguage == contentLanguage.ENGLISH) languageKey = 'en'; @@ -521,6 +523,11 @@ function CreateNewPlace() { }; }); } + if (values?.coordinates) { + const coordinates = values.coordinates.split(','); + latitude = coordinates[0] || undefined; + longitude = coordinates[1] || undefined; + } placeObj = { name: { @@ -538,8 +545,8 @@ function CreateNewPlace() { containedInPlace: containedInPlaceObj, }), geo: { - latitude: values?.latitude, - longitude: values?.longitude, + latitude, + longitude, }, ...((values?.frenchAccessibilityNote || values?.englishAccessibilityNote) && {