From daa0b872601789815513508d48a14cbd8e1f6518 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Mon, 23 Dec 2024 13:39:47 +0700 Subject: update pengajuan tempo --- src/lib/address/components/EditAddress.jsx | 7 +++---- src/lib/pengajuan-tempo/component/PengajuanTempo.jsx | 1 - .../pengajuan-tempo/component/informasiPerusahaan.jsx | 8 +++++--- src/lib/tempo/components/Tempo.jsx | 16 +++++++++------- 4 files changed, 17 insertions(+), 15 deletions(-) (limited to 'src/lib') 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]); diff --git a/src/lib/pengajuan-tempo/component/PengajuanTempo.jsx b/src/lib/pengajuan-tempo/component/PengajuanTempo.jsx index 22227624..dbf2c606 100644 --- a/src/lib/pengajuan-tempo/component/PengajuanTempo.jsx +++ b/src/lib/pengajuan-tempo/component/PengajuanTempo.jsx @@ -550,7 +550,6 @@ const PengajuanTempo = () => { // if (isLoading && !bigData) { // return; // } - console.log('bigData', bigData); return ( <>
diff --git a/src/lib/pengajuan-tempo/component/informasiPerusahaan.jsx b/src/lib/pengajuan-tempo/component/informasiPerusahaan.jsx index 4bc04a3f..fc0f1c28 100644 --- a/src/lib/pengajuan-tempo/component/informasiPerusahaan.jsx +++ b/src/lib/pengajuan-tempo/component/informasiPerusahaan.jsx @@ -95,8 +95,6 @@ const InformasiPerusahaan = ({ useEffect(() => { if (watchCity) { - updateForm('city', `${watchCity}`); - validate(); const loadDistricts = async () => { let dataDistricts = await districtApi({ cityId: watchCity }); dataDistricts = dataDistricts.map((district) => ({ @@ -105,9 +103,13 @@ const InformasiPerusahaan = ({ })); setDistricts(dataDistricts); }; + if (form.city !== `${watchCity}`) { + updateForm('city', `${watchCity}`); + } + validate(); loadDistricts(); } - }, [watchCity, setValue]); + }, [watchCity]); const watchDistrict = watch('district'); useEffect(() => { diff --git a/src/lib/tempo/components/Tempo.jsx b/src/lib/tempo/components/Tempo.jsx index 97b21454..6f0a2a8c 100644 --- a/src/lib/tempo/components/Tempo.jsx +++ b/src/lib/tempo/components/Tempo.jsx @@ -323,7 +323,7 @@ const Tempo = () => {

-
+

Kredit Limit Terpakai

{ // // Tidak ada invoice // - Registrasi Tempo +
+ Registrasi Tempo +
) : ( invoices.data?.invoices?.map((invoice, index) => (