diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-12-06 17:06:26 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-12-06 17:06:26 +0700 |
| commit | e9cd13307f0095dc4edc5048752675d80c551564 (patch) | |
| tree | ba133ca989725bd225e3ed1517ddece8a33e3f32 /src/lib/pengajuan-tempo/component/Referensi.jsx | |
| parent | 9a49b8d84761781531cb417731cb9ef802f63541 (diff) | |
<iman> pengajuan tempo
Diffstat (limited to 'src/lib/pengajuan-tempo/component/Referensi.jsx')
| -rw-r--r-- | src/lib/pengajuan-tempo/component/Referensi.jsx | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/lib/pengajuan-tempo/component/Referensi.jsx b/src/lib/pengajuan-tempo/component/Referensi.jsx index e285c2b9..6d9d0bd6 100644 --- a/src/lib/pengajuan-tempo/component/Referensi.jsx +++ b/src/lib/pengajuan-tempo/component/Referensi.jsx @@ -49,6 +49,7 @@ const Referensi = ({ chekValid, buttonSubmitClick, data }) => { creditLimit: '', }); const onChangeInput = (e, index) => { + updateHasSave(false); const { name, value } = e.target; let formattedValue = value; @@ -64,10 +65,13 @@ const Referensi = ({ chekValid, buttonSubmitClick, data }) => { ); setSupplierData(editData); - updateHasSave(false); + if (value == '') { + updateHasSave(true); + } }; const handleNewSupplierChange = (e) => { + updateHasSave(false); const { name, value } = e.target; let formattedValue = value; @@ -80,18 +84,21 @@ const Referensi = ({ chekValid, buttonSubmitClick, data }) => { const updatedSupplier = { ...newSupplier, [name]: formattedValue }; setNewSupplier(updatedSupplier); - updateHasSave(false); + if (value == '') { + updateHasSave(true); + } }; const handleDeleteSupplier = (index) => { + // updateHasSave(false); // Indikasi bahwa data telah berubah const updatedData = supplierData.filter((_, i) => i !== index); setSupplierData(updatedData); updateFormSupplier(updatedData); // Update store atau state terkait - updateHasSave(false); // Indikasi bahwa data telah berubah }; const handleAddNewSupplier = () => { + // updateHasSave(false); if (Object.values(newSupplier).every((val) => val.trim() !== '')) { setSupplierData((prevData) => { const newData = [...prevData, newSupplier]; @@ -106,7 +113,6 @@ const Referensi = ({ chekValid, buttonSubmitClick, data }) => { creditLimit: '', }); } - updateHasSave(false); }; useEffect(() => { |
