summaryrefslogtreecommitdiff
path: root/src/lib/checkout/components
diff options
context:
space:
mode:
authortrisusilo48 <tri.susilo@altama.co.id>2025-03-27 14:44:54 +0700
committertrisusilo48 <tri.susilo@altama.co.id>2025-03-27 14:44:54 +0700
commit969e193708e01ffb88c0d81d72d63dad200e0ef8 (patch)
tree59c44292727bdfecb2970cb1d8130c53c0075653 /src/lib/checkout/components
parentf88f457fd1b91298ea8a7f9f396e49660a81e276 (diff)
parentd64f70fbc89e2cea6cbd95f5c3e3af437a3c2810 (diff)
Merge branch 'new-release' into feature/integrasi_biteship
# Conflicts: # src/lib/address/components/EditAddress.jsx
Diffstat (limited to 'src/lib/checkout/components')
-rw-r--r--src/lib/checkout/components/Checkout.jsx15
-rw-r--r--src/lib/checkout/components/CheckoutSection.jsx2
2 files changed, 15 insertions, 2 deletions
diff --git a/src/lib/checkout/components/Checkout.jsx b/src/lib/checkout/components/Checkout.jsx
index fa8d8aea..637706a2 100644
--- a/src/lib/checkout/components/Checkout.jsx
+++ b/src/lib/checkout/components/Checkout.jsx
@@ -184,6 +184,7 @@ const Checkout = () => {
let dataVoucher = await getVoucher(auth?.id, {
source: query,
type: 'all,brand',
+ partner_id : auth?.partnerId,
});
SetListVoucher(dataVoucher);
@@ -411,13 +412,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);
diff --git a/src/lib/checkout/components/CheckoutSection.jsx b/src/lib/checkout/components/CheckoutSection.jsx
index 623152c6..c82e15c7 100644
--- a/src/lib/checkout/components/CheckoutSection.jsx
+++ b/src/lib/checkout/components/CheckoutSection.jsx
@@ -33,7 +33,7 @@ export const SectionAddress = ({ address, label, url }) => {
};
export const SectionValidation = ({ address }) =>
- address?.rajaongkirCityId == 0 && (
+ address?.stateId == 0 && (
<BottomPopup active={true} title='Update Alamat'>
<div className='leading-7 text-gray_r-12/80'>
Mohon untuk memperbarui alamat Anda dengan mengklik tombol di bawah ini.{' '}