summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2025-02-27 09:51:25 +0700
committerit-fixcomart <it@fixcomart.co.id>2025-02-27 09:51:25 +0700
commitb3daa04df2a723687250a5fe0787aefc08626129 (patch)
treedb70c2a46d566855b59722246ac4239a0041bf1a /src
parent6c4fe7aec3aec0879fd0880cffe02263b4655f29 (diff)
<iman> CR if has nomor po then must opload file po
Diffstat (limited to 'src')
-rw-r--r--src/lib/checkout/components/Checkout.jsx14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/lib/checkout/components/Checkout.jsx b/src/lib/checkout/components/Checkout.jsx
index a9495a74..a8b31ece 100644
--- a/src/lib/checkout/components/Checkout.jsx
+++ b/src/lib/checkout/components/Checkout.jsx
@@ -483,13 +483,25 @@ const Checkout = () => {
if (query) {
data.source = 'buy';
}
- if (poNumber.current.value) data.po_number = poNumber.current.value;
+ if (poNumber.current.value) {
+ if (typeof file == 'undefined') {
+ toast.error(
+ 'Nomor PO ' +
+ poNumber.current.value +
+ ' telah dimasukkan, Harap upload file PO yang dimaksud'
+ );
+ setIsLoading(false);
+ return;
+ }
+ data.po_number = poNumber.current.value;
+ }
if (typeof file !== 'undefined') data.po_file = await getFileBase64(file);
const isCheckouted = await checkoutApi({ data });
if (!isCheckouted?.id) {
toast.error('Gagal melakukan transaksi, terjadi kesalahan internal');
+ setIsLoading(false);
return;
} else {
gtagPurchase(products, biayaKirim, isCheckouted.name);