From daa0b872601789815513508d48a14cbd8e1f6518 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Mon, 23 Dec 2024 13:39:47 +0700
Subject: <iman> update pengajuan tempo

---
 src/lib/address/components/EditAddress.jsx | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

(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 e12aba13..62858465 100644
--- a/src/lib/address/components/EditAddress.jsx
+++ b/src/lib/address/components/EditAddress.jsx
@@ -39,7 +39,6 @@ const EditAddress = ({ id, defaultValues }) => {
   useEffect(() => {
     const loadProfile = async () => {
       const dataProfile = await addressApi({ id: auth.parentId });
-      console.log('dataProfile', dataProfile);
       setValue('industry', dataProfile.industryId);
       setValue('companyType', dataProfile.companyTypeId);
       setValue('taxName', dataProfile.taxName);
@@ -47,9 +46,9 @@ const EditAddress = ({ id, defaultValues }) => {
       setValue('alamat_wajib_pajak', dataProfile.alamatWajibPajak);
       setValue('alamat_bisnis', dataProfile.alamatBisnis);
       setValue('business_name', dataProfile.name);
-      setValue('city', dataProfile.city.id);
-      setValue('district', dataProfile.district.id);
-      setValue('subDistrict', dataProfile.subDistrict.id);
+      setValue('city', dataProfile.city?.id);
+      setValue('district', dataProfile.district?.id);
+      setValue('subDistrict', dataProfile.subDistrict?.id);
     };
     if (auth) loadProfile();
   }, [auth?.parentId]);
-- 
cgit v1.2.3

