diff options
Diffstat (limited to 'src/lib/auth/components/SwitchAccount.jsx')
| -rw-r--r-- | src/lib/auth/components/SwitchAccount.jsx | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/src/lib/auth/components/SwitchAccount.jsx b/src/lib/auth/components/SwitchAccount.jsx index 14ad7e8a..fa1d3924 100644 --- a/src/lib/auth/components/SwitchAccount.jsx +++ b/src/lib/auth/components/SwitchAccount.jsx @@ -74,17 +74,18 @@ const SwitchAccount = () => { const dataProfile = await addressApi({ id: auth.parentId ? auth.parentId : auth.parent_id, }); - if (dataProfile.companyType === 'Non PKP') { + console.log('dataProfile', dataProfile); + if (dataProfile?.companyType === 'nonpkp') { setSelectedValue('PKP'); } - updateForm('email_partner', dataProfile.email_partner); - updateForm('business_name', dataProfile.name); - updateForm('industry_id', `${dataProfile.industryId}`); - updateForm('company_type_id', `${dataProfile.companyTypeId}`); - updateForm('nama_wajib_pajak', dataProfile.taxName); - updateForm('npwp', dataProfile.npwp); - updateForm('alamat_wajib_pajak', dataProfile.alamatWajibPajak); - updateForm('alamat_bisnis', dataProfile.alamatBisnis); + updateForm('email_partner', dataProfile?.email_partner); + updateForm('business_name', dataProfile?.name); + updateForm('industry_id', `${dataProfile?.industryId}`); + updateForm('company_type_id', `${dataProfile?.companyTypeId}`); + updateForm('nama_wajib_pajak', dataProfile?.taxName); + updateForm('npwp', dataProfile?.npwp); + updateForm('alamat_wajib_pajak', dataProfile?.alamatWajibPajak); + updateForm('alamat_bisnis', dataProfile?.alamatBisnis); validate(); }; if (auth) loadProfile(); @@ -214,17 +215,17 @@ const SwitchAccount = () => { <div className='flex justify-end mb-4 mr-4'> <button type='submit' - onClick={onSubmitHandlerCancel} - className='btn-red w-full sm:w-fit sm:ml-auto mt-6' + onClick={onSubmitHandler} + className='btn-yellow w-full sm:w-fit sm:ml-auto mt-6' > - {mutation.isLoading ? 'Loading...' : 'Batal'} + {mutation.isLoading ? 'Loading...' : 'Simpan Perubahan'} </button> <button type='submit' - onClick={onSubmitHandler} - className='btn-yellow w-full sm:w-fit sm:ml-auto mt-6' + onClick={onSubmitHandlerCancel} + className='btn-red w-full sm:w-fit sm:ml-auto mt-6' > - {mutation.isLoading ? 'Loading...' : 'Simpan Perubahan'} + {mutation.isLoading ? 'Loading...' : 'Batal'} </button> </div> </div> |
