summaryrefslogtreecommitdiff
path: root/src/lib/pengajuan-tempo/component
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2025-01-16 09:13:04 +0700
committerit-fixcomart <it@fixcomart.co.id>2025-01-16 09:13:04 +0700
commit68e1d6e55b6d38d86c2b3332268fb508de0a2db8 (patch)
tree138bed67c90a292e81805863cf9c304f32662bfb /src/lib/pengajuan-tempo/component
parent8035f129863f0a401f529cc0cd69a2131ccaba80 (diff)
<iman> comment compres file
Diffstat (limited to 'src/lib/pengajuan-tempo/component')
-rw-r--r--src/lib/pengajuan-tempo/component/Dokumen.jsx45
-rw-r--r--src/lib/pengajuan-tempo/component/PengajuanTempo.jsx2
2 files changed, 24 insertions, 23 deletions
diff --git a/src/lib/pengajuan-tempo/component/Dokumen.jsx b/src/lib/pengajuan-tempo/component/Dokumen.jsx
index 00bb715a..f986d47a 100644
--- a/src/lib/pengajuan-tempo/component/Dokumen.jsx
+++ b/src/lib/pengajuan-tempo/component/Dokumen.jsx
@@ -44,28 +44,29 @@ const Dokumen = ({ chekValid, buttonSubmitClick, isKonfirmasi }) => {
}
// Check for file size
- if (file.size > 500000) {
- try {
- const toastId = toast.loading('mencoba mengompresi file...');
- // Compress image file
- const options = {
- maxSizeMB: 0.5, // Target size in MB
- maxWidthOrHeight: 1920, // Adjust as needed
- useWebWorker: true,
- };
- const compressedFile = await imageCompression(file, options);
- toast.success('berhasil mengompresi file', { duration: 4000 });
- // Convert compressed file to Base64
- fileBase64 = await getFileBase64(compressedFile);
- updateFormDokumen(
- name,
- compressedFile.name,
- fileExtension,
- fileBase64
- );
- } catch (error) {
- toast.error('Gagal mengompresi file', { duration: 4000 });
- }
+ if (file.size > 2000000) {
+ // try {
+ // const toastId = toast.loading('mencoba mengompresi file...');
+ // // Compress image file
+ // const options = {
+ // maxSizeMB: 0.5, // Target size in MB
+ // maxWidthOrHeight: 1920, // Adjust as needed
+ // useWebWorker: true,
+ // };
+ // const compressedFile = await imageCompression(file, options);
+ // toast.success('berhasil mengompresi file', { duration: 4000 });
+ // // Convert compressed file to Base64
+ // fileBase64 = await getFileBase64(compressedFile);
+ // updateFormDokumen(
+ // name,
+ // compressedFile.name,
+ // fileExtension,
+ // fileBase64
+ // );
+ // } catch (error) {
+ // toast.error('Gagal mengompresi file', { duration: 4000 });
+ // }
+ toast.error('Max File Upload 2MB', { duration: 4000 });
} else {
// Convert file to Base64
fileBase64 = await getFileBase64(file);
diff --git a/src/lib/pengajuan-tempo/component/PengajuanTempo.jsx b/src/lib/pengajuan-tempo/component/PengajuanTempo.jsx
index 018668b6..5bef5134 100644
--- a/src/lib/pengajuan-tempo/component/PengajuanTempo.jsx
+++ b/src/lib/pengajuan-tempo/component/PengajuanTempo.jsx
@@ -392,7 +392,7 @@ const PengajuanTempo = () => {
// Periksa perubahan
const toastId = toast.loading('Mengirimkan formulir pengajuan tempo...');
- if (bigData.supplierIds) {
+ if (bigData?.supplierIds) {
if (!isSupplierDataChanged(productOrder, bigData.supplierIds)) {
return;
}