summaryrefslogtreecommitdiff
path: root/src/lib/quotation/components/Quotation.jsx
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-09-04 09:50:46 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-09-04 09:50:46 +0700
commitcbdeecd2fb8770afe46a374292e6ed3e5ec48214 (patch)
tree9096b5d726b261f50222d9c50d8bb98c12cb6c4a /src/lib/quotation/components/Quotation.jsx
parent985f29aa1d9b8cbea49d25c30099f88c86bdc13f (diff)
parent702b5d9b6e215ad812fadaff3325e1e6164d3b24 (diff)
Merge branch 'Feature/new-cart-popup' into backup-release
Diffstat (limited to 'src/lib/quotation/components/Quotation.jsx')
-rw-r--r--src/lib/quotation/components/Quotation.jsx7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/quotation/components/Quotation.jsx b/src/lib/quotation/components/Quotation.jsx
index df234dc2..0ad042de 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 { setRefreshCart } = 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}`);
+ setRefreshCart(true);
return;
}