From ae6033238a4e7765bce7cbe96a2662f3c00b67c1 Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Sat, 31 Aug 2024 09:51:26 +0700 Subject: upadate new cart pop up --- src-migrate/modules/cart/components/ItemAction.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src-migrate/modules/cart/components') diff --git a/src-migrate/modules/cart/components/ItemAction.tsx b/src-migrate/modules/cart/components/ItemAction.tsx index e73d507b..7220e362 100644 --- a/src-migrate/modules/cart/components/ItemAction.tsx +++ b/src-migrate/modules/cart/components/ItemAction.tsx @@ -11,7 +11,7 @@ import { deleteUserCart, upsertUserCart } from '~/services/cart' import { useDebounce } from 'usehooks-ts' import { useCartStore } from '../stores/useCartStore' - +import { useProductCartContext } from '@/contexts/ProductCartContext' type Props = { item: CartItem @@ -19,7 +19,7 @@ type Props = { const CartItemAction = ({ item }: Props) => { const auth = getAuth() - + const { setRefreshCart } = useProductCartContext() const [isLoadDelete, setIsLoadDelete] = useState(false) const [isLoadQuantity, setIsLoadQuantity] = useState(false) @@ -36,6 +36,7 @@ const CartItemAction = ({ item }: Props) => { await deleteUserCart(auth.id, [item.cart_id]) await loadCart(auth.id) setIsLoadDelete(false) + setRefreshCart(true) } const decreaseQty = () => { setQuantity((quantity) => quantity -= 1) } -- cgit v1.2.3