From 3e8a67cc49a46a5a6527aea04e608cf7214b11b9 Mon Sep 17 00:00:00 2001
From: Miqdad <ahmadmiqdad27@gmail.com>
Date: Mon, 29 Sep 2025 14:48:25 +0700
Subject: <Miqdad> remove validation for dispatch

---
 app/page.tsx | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

(limited to 'app/page.tsx')

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(/^.*?,/, "");
-- 
cgit v1.2.3

