diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-08-02 13:30:56 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-08-02 13:30:56 +0700 |
| commit | 1f5adcf66c175dde3ce3694eedb1acddb05613e5 (patch) | |
| tree | 2d3dad2647c7523c2b414f1d0097f501e5c1d09b /src-migrate/pages | |
| parent | 30a686e4140a503d88142e71c25bc517092b4bd5 (diff) | |
<iman> add refresh cart after delete chart
Diffstat (limited to 'src-migrate/pages')
| -rw-r--r-- | src-migrate/pages/shop/cart/index.tsx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src-migrate/pages/shop/cart/index.tsx b/src-migrate/pages/shop/cart/index.tsx index 4586c65c..d28e8c4b 100644 --- a/src-migrate/pages/shop/cart/index.tsx +++ b/src-migrate/pages/shop/cart/index.tsx @@ -17,6 +17,7 @@ import Image from '~/components/ui/image'; import { CartItem } from '~/types/cart' import { deleteUserCart ,upsertUserCart } from '~/services/cart' import { Trash2Icon } from 'lucide-react'; +import { useProductCartContext } from '@/contexts/ProductCartContext' const CartPage = () => { const router = useRouter(); @@ -29,6 +30,7 @@ const CartPage = () => { const [isLoadDelete, setIsLoadDelete] = useState<boolean>(false) const { loadCart, cart, summary } = useCartStore(); const useDivvice = useDevice(); + const { setRefreshCart } = useProductCartContext() useEffect(() => { if (typeof auth === 'object' && !cart) { @@ -99,6 +101,7 @@ const CartPage = () => { } } setIsLoadDelete(false) + setRefreshCart(true) } return ( |
