summaryrefslogtreecommitdiff
path: root/src/lib/quotation/components/Quotation.jsx
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-07-12 14:37:06 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-07-12 14:37:06 +0700
commit8c2c97c064e39983755f5789244a032702363944 (patch)
treef09940ae01151b9828df61ec7fd46085e3503e0e /src/lib/quotation/components/Quotation.jsx
parent721067120c2756554829070b3fa10de7f04ae705 (diff)
<iman> add note
Diffstat (limited to 'src/lib/quotation/components/Quotation.jsx')
-rw-r--r--src/lib/quotation/components/Quotation.jsx15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/lib/quotation/components/Quotation.jsx b/src/lib/quotation/components/Quotation.jsx
index 19419f61..d6cc4866 100644
--- a/src/lib/quotation/components/Quotation.jsx
+++ b/src/lib/quotation/components/Quotation.jsx
@@ -79,7 +79,7 @@ const Quotation = () => {
const [addresses, setAddresses] = useState(null);
- const [note_websiteText, setselectedNote_websiteText] = useState(null);
+ const [note_websiteText, setselectedNote_websiteText] = useState('');
useEffect(() => {
if (!auth) return;
@@ -265,8 +265,8 @@ const Quotation = () => {
if (!products || products.length == 0) return;
- if (auth?.feature?.soApproval && !note_websiteText.trim()) {
- toast.error('Note harus diisi karena fitur soApproval aktif.');
+ if (isApproval && note_websiteText == '') {
+ toast.error('Maaf, Note wajib dimasukkan.');
return;
}
@@ -286,22 +286,21 @@ const Quotation = () => {
delivery_service_type: selectedExpedisiService,
note_website : note_websiteText,
};
- console.log('data checkout', data);
+
const isSuccess = await checkoutApi({ data });
- console.log('isSuccess', isSuccess);
+ ;
setIsLoading(false);
if (isSuccess?.id) {
for (const product of products) deleteItemCart({ productId: product.id });
router.push(`/shop/quotation/finish?id=${isSuccess.id}`);
return;
}
+
toast.error('Gagal melakukan transaksi, terjadi kesalahan internal');
};
const taxTotal = (totalAmount - totalDiscountAmount) * 0.11;
- console.log("note_websiteText",note_websiteText)
-
return (
<>
<MobileView>
@@ -592,7 +591,7 @@ const Quotation = () => {
<div className='flex gap-x-1 flex-col mb-4'>
<div className='mb-2'>Note</div>
- <div className='font-semibold text-gray_r-12'>
+ <div className='text-caption-2 text-gray_r-11'>
<textarea
rows="4"
cols="50"