diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2024-08-03 02:00:13 +0000 |
|---|---|---|
| committer | trisusilo <tri.susilo@altama.co.id> | 2024-08-03 02:00:13 +0000 |
| commit | 07674f2a1cf90a90d605764409d62a46a836c9ba (patch) | |
| tree | 1577d4a365c6efb2e5c9483eca6103590756fae9 /src-migrate/modules/cart/components/ItemAction.tsx | |
| parent | 99a5965e1e5320e9acbc9718c3642ffae85bec57 (diff) | |
| parent | 4e25a60e9c3cf93cc1faf77a5bf1ad7e6f0555ec (diff) | |
Merged in Feature/iman-unchek-cart (pull request #209)
Feature/iman unchek cart
Approved-by: trisusilo
Diffstat (limited to 'src-migrate/modules/cart/components/ItemAction.tsx')
| -rw-r--r-- | src-migrate/modules/cart/components/ItemAction.tsx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src-migrate/modules/cart/components/ItemAction.tsx b/src-migrate/modules/cart/components/ItemAction.tsx index e73d507b..e5e7f314 100644 --- a/src-migrate/modules/cart/components/ItemAction.tsx +++ b/src-migrate/modules/cart/components/ItemAction.tsx @@ -11,6 +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 = { @@ -19,7 +20,7 @@ type Props = { const CartItemAction = ({ item }: Props) => { const auth = getAuth() - + const { setRefreshCart } = useProductCartContext() const [isLoadDelete, setIsLoadDelete] = useState<boolean>(false) const [isLoadQuantity, setIsLoadQuantity] = useState<boolean>(false) @@ -36,6 +37,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) } |
