From bc4fe87e012cc1b06572ca12f1a3b92f6d1757e0 Mon Sep 17 00:00:00 2001
From: trisusilo48 <tri.susilo@altama.co.id>
Date: Thu, 31 Oct 2024 09:09:05 +0700
Subject: detail adress

---
 src/lib/address/components/CreateAddress.jsx | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

(limited to 'src/lib/address/components/CreateAddress.jsx')

diff --git a/src/lib/address/components/CreateAddress.jsx b/src/lib/address/components/CreateAddress.jsx
index 70307401..a53be0fa 100644
--- a/src/lib/address/components/CreateAddress.jsx
+++ b/src/lib/address/components/CreateAddress.jsx
@@ -41,7 +41,7 @@ const CreateAddress = () => {
   const [subDistricts, setSubDistricts] = useState([]);
   const [filteredTypes, setFilteredTypes] = useState(types); // State to manage filtered types
   const [pinedMaps, setPinedMaps] = useState(false);
-  const { addressMaps, setAddressMaps } = useMaps();
+  const { addressMaps, setAddressMaps, selectedPosition, setSelectedPosition } = useMaps();
 
   useEffect(() => {
     const loadState = async () => {
@@ -131,9 +131,12 @@ const CreateAddress = () => {
       district_id: values.district,
       sub_district_id: values.subDistrict,
       parent_id: auth.partnerId,
+      latitude: selectedPosition?.lat,
+      longtitude: selectedPosition?.lng,
+      address_maps: JSON.stringify(addressMaps),
     };
-
-    const address = await createAddressApi({ data });
+console.log('ini data',data);
+    // const address = await createAddressApi({ data });
     if (address?.id) {
       toast.success('Berhasil menambahkan alamat');
       router.back();
-- 
cgit v1.2.3

