From b88292ed2c51bc790f91fabbd7f99e882115f328 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Thu, 13 Mar 2025 09:47:52 +0700
Subject: <iman> add logic edit addres

---
 src/lib/address/components/EditAddress.jsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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

diff --git a/src/lib/address/components/EditAddress.jsx b/src/lib/address/components/EditAddress.jsx
index 62858465..f9fe9785 100644
--- a/src/lib/address/components/EditAddress.jsx
+++ b/src/lib/address/components/EditAddress.jsx
@@ -161,7 +161,7 @@ const EditAddress = ({ id, defaultValues }) => {
     }
 
     // if (isUpdated?.id) {
-    if (address?.id && auth.company ? isUpdated?.id : true) {
+    if (address?.id && (auth.company && auth?.partnerId == id ? isUpdated?.id : true)) {
       toast.success('Berhasil mengubah alamat');
       router.back();
     } else {
-- 
cgit v1.2.3


From 34d09341b6c0ebf5c4bcd02368c54de290ac73b8 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Tue, 18 Mar 2025 13:40:56 +0700
Subject: <iman> update get data edit alamat

---
 src/lib/address/components/EditAddress.jsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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

diff --git a/src/lib/address/components/EditAddress.jsx b/src/lib/address/components/EditAddress.jsx
index f9fe9785..ba6bd25b 100644
--- a/src/lib/address/components/EditAddress.jsx
+++ b/src/lib/address/components/EditAddress.jsx
@@ -38,7 +38,7 @@ const EditAddress = ({ id, defaultValues }) => {
 
   useEffect(() => {
     const loadProfile = async () => {
-      const dataProfile = await addressApi({ id: auth.parentId });
+      const dataProfile = await addressApi({ id: auth.partnerId });
       setValue('industry', dataProfile.industryId);
       setValue('companyType', dataProfile.companyTypeId);
       setValue('taxName', dataProfile.taxName);
-- 
cgit v1.2.3

