From 31ef67c8c2c3d80bf0c0cc040e551b4a45c3dedc Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Fri, 27 Sep 2024 15:36:39 +0700
Subject: <iman> update form bisnis to switch account

---
 src/lib/auth/components/CompanyProfile.jsx | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

(limited to 'src/lib/auth/components/CompanyProfile.jsx')

diff --git a/src/lib/auth/components/CompanyProfile.jsx b/src/lib/auth/components/CompanyProfile.jsx
index e1a604c2..6065efde 100644
--- a/src/lib/auth/components/CompanyProfile.jsx
+++ b/src/lib/auth/components/CompanyProfile.jsx
@@ -16,7 +16,7 @@ const CompanyProfile = () => {
   const [changeConfirmation, setChangeConfirmation] = useState(false);
   const [changeType, setChangeType] = useState(false);
   const [isChecked, setIsChecked] = useState(false);
-  const [company_type, setCompany_type] = useState('Non PKP');
+  const [company_type, setCompany_type] = useState('nonpkp');
   const auth = useAuth();
   const [isOpen, setIsOpen] = useState(false);
   const toggle = () => setIsOpen(!isOpen);
@@ -61,15 +61,15 @@ const CompanyProfile = () => {
       const dataProfile = await addressApi({
         id: auth.parentId ? auth.parentId : auth.parent_id,
       });
-      setCompany_type(dataProfile.companyType);
-      setValue('name', dataProfile.name);
-      setValue('industry', dataProfile.industryId);
-      setValue('companyType', dataProfile.companyTypeId);
-      setValue('taxName', dataProfile.taxName);
-      setValue('npwp', dataProfile.npwp);
-      setValue('alamat_wajib_pajak', dataProfile.alamatWajibPajak);
-      setValue('alamat_bisnis', dataProfile.alamatBisnis);
-      setValue('company_type', dataProfile.companyType);
+      setCompany_type(dataProfile?.companyType);
+      setValue('name', dataProfile?.name);
+      setValue('industry', dataProfile?.industryId);
+      setValue('companyType', dataProfile?.companyTypeId);
+      setValue('taxName', dataProfile?.taxName);
+      setValue('npwp', dataProfile?.npwp);
+      setValue('alamat_wajib_pajak', dataProfile?.alamatWajibPajak);
+      setValue('alamat_bisnis', dataProfile?.alamatBisnis);
+      setValue('company_type', dataProfile?.companyType);
     };
     if (auth) loadProfile();
   }, [auth, setValue]);
@@ -168,7 +168,7 @@ const CompanyProfile = () => {
         </div>
       </BottomPopup>
       <div className='p-4 flex-row items-center text-left w-full'>
-        {company_type === 'Non PKP' && (
+        {company_type === 'nonpkp' && (
           <div className='text-sm mb-2 flex items-center'>
             <Checkbox
               borderColor='gray.600'
-- 
cgit v1.2.3

