diff options
| author | Miqdad <ahmadmiqdad27@gmail.com> | 2025-09-29 14:48:25 +0700 |
|---|---|---|
| committer | Miqdad <ahmadmiqdad27@gmail.com> | 2025-09-29 14:48:25 +0700 |
| commit | 3e8a67cc49a46a5a6527aea04e608cf7214b11b9 (patch) | |
| tree | aaeb02d92db1f453645587943dc70a5b0e71f41d | |
| parent | 199f1527b5b948291e9526625ae992ea4cfde3d9 (diff) | |
<Miqdad> remove validation for dispatch
| -rw-r--r-- | app/page.tsx | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/app/page.tsx b/app/page.tsx index b3c00b8..f295c33 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -100,21 +100,27 @@ export default function Home() { event.preventDefault(); setIsLoading(true); - const needDispatch = isDispatch; - const needDriver = isDriver; - - if (!barcode || !imageSj || (!imagePackage && needDriver)) { - alert("Barcode, Foto SJ, dan Foto Penerima harus tersedia."); + if (!barcode) { + alert("Barcode harus diisi."); setIsLoading(false); return; } - if (!barcode || (!imageDispatch && needDispatch)) { - alert("Foto Dispatch Wajib Diisi"); - setIsLoading(false); - return; + if (isDispatch) { + if (!imageDispatch) { + alert("Foto Dispatch Wajib Diisi"); + setIsLoading(false); + return; + } + } else { + if (!imageSj || !imagePackage) { + alert("Barcode, Foto SJ, dan Foto Penerima harus tersedia."); + setIsLoading(false); + return; + } } + try { // const newSjImage = imageSj.replace(/^.*?,/, ""); // const newPackageImage = imagePackage.replace(/^.*?,/, ""); |
