From bad8abd263bd43c59dad8e61e2f5f35bfe5b7746 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Thu, 8 Aug 2024 11:37:58 +0700
Subject: <iman> update quotation pop up

---
 src/lib/quotation/components/Quotation.jsx | 7 +++++--
 1 file changed, 5 insertions(+), 2 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 df234dc2..3fac6f29 100644
--- a/src/lib/quotation/components/Quotation.jsx
+++ b/src/lib/quotation/components/Quotation.jsx
@@ -9,6 +9,7 @@ import _ from 'lodash';
 import { deleteItemCart, getCart, getItemCart } from '@/core/utils/cart';
 import currencyFormat from '@/core/utils/currencyFormat';
 import { toast } from 'react-hot-toast';
+import { useProductCartContext } from '@/contexts/ProductCartContext';
 // import checkoutApi from '@/lib/checkout/api/checkoutApi'
 import { useRouter } from 'next/router';
 import VariantGroupCard from '@/lib/variant/components/VariantGroupCard';
@@ -38,11 +39,12 @@ const { getProductsCheckout } = require('@/lib/checkout/api/checkoutApi');
 const Quotation = () => {
   const router = useRouter();
   const auth = useAuth();
-
+  
   const { data: cartCheckout } = useQuery('cartCheckout', () =>
     getProductsCheckout()
-  );
+);
 
+const {  setRefreshQuotation } = useProductCartContext();
   const SELF_PICKUP_ID = 32;
 
   const [products, setProducts] = useState(null);
@@ -293,6 +295,7 @@ const Quotation = () => {
     if (isSuccess?.id) {
       for (const product of products) deleteItemCart({ productId: product.id });
       router.push(`/shop/quotation/finish?id=${isSuccess.id}`);
+      setRefreshQuotation(true);
       return;
     }
     
-- 
cgit v1.2.3

