From bd4cdf2125f717875ba90e03893b319dd962f753 Mon Sep 17 00:00:00 2001
From: trisusilo48 <tri.susilo@altama.co.id>
Date: Sat, 18 Jan 2025 10:37:49 +0700
Subject: bittesip

---
 src/lib/checkout/components/SectionExpedition.jsx | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

(limited to 'src/lib/checkout/components/SectionExpedition.jsx')

diff --git a/src/lib/checkout/components/SectionExpedition.jsx b/src/lib/checkout/components/SectionExpedition.jsx
index 8b59d210..5b4f6bfc 100644
--- a/src/lib/checkout/components/SectionExpedition.jsx
+++ b/src/lib/checkout/components/SectionExpedition.jsx
@@ -228,13 +228,10 @@ export default function SectionExpedition({ products }) {
     }
   );
 
-  console.log('ini response', data);
-
   useEffect(() => {
     if (data) {
       const couriers = reverseMappingCourier(listExpedisi, data?.data?.pricing);
       setCouriers(couriers);
-      console.log('ini scourier', couriers);
     }
   }, [data]);
 
@@ -249,7 +246,15 @@ export default function SectionExpedition({ products }) {
         setSelectedCourier(courier.courier.courier_code);
         setServiceOptions(Object.values(courier.courier.service_type));
       } else {
-        toast.error('Maaf, layanan tidak tersedia. Mohon pilih expedisi lain.');
+        if ((courier.label === 'GRAB' || courier.label === 'GOJEK') && !addressMaps) {
+          toast.error(
+            'Maaf, layanan kurir ' + courier.label + ' tidak tersedia. Karena Anda Belum Melakukan Pengaturan PinPoint Alamat Pegiriman.'
+          )
+        } else {
+          toast.error(
+            'Maaf, layanan tidak tersedia. Mohon pilih expedisi lain.'
+          );
+        }
       }
     } else {
       setSelectedCourier(courier === 32 ? 'SELF PICKUP' : null);
@@ -376,7 +381,8 @@ export default function SectionExpedition({ products }) {
         )}
       </div>
 
-      {serviceOptions.length > 0 && selectedCourier &&
+      {serviceOptions.length > 0 &&
+        selectedCourier &&
         selectedCourier !== 32 &&
         selectedCourier !== 0 && (
           <div className='px-4 py-2'>
-- 
cgit v1.2.3

