summaryrefslogtreecommitdiff
path: root/src/lib/checkout
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2025-03-12 14:30:25 +0700
committerit-fixcomart <it@fixcomart.co.id>2025-03-12 14:30:25 +0700
commit6a682891b755a6f8d91edafe54a62047afcb5492 (patch)
treef8fee880ed7129093f21dc069074767eafce261f /src/lib/checkout
parentf4adb008ae55e4b340c58c32d45af6d0eaf6eb57 (diff)
parentd36a21cb0a6e95323fa9dd868a79bf1a318968e3 (diff)
Merge branch 'new-release' into CR/repeat-order
Diffstat (limited to 'src/lib/checkout')
-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);