From 8c2c97c064e39983755f5789244a032702363944 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Fri, 12 Jul 2024 14:37:06 +0700
Subject: <iman> add note

---
 src/lib/quotation/components/Quotation.jsx | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

(limited to 'src/lib/quotation/components/Quotation.jsx')

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"
-- 
cgit v1.2.3

