diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-08-05 09:38:32 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-08-05 09:38:32 +0700 |
| commit | 8aa9307006910e5b512fc6551f0046f0c5a6a2d5 (patch) | |
| tree | 4380367b52d4881e37d26b4f5477b6eec462a91c /src-migrate/modules/cart/stores/useCartStore.ts | |
| parent | 574754df6366cd693fbe2cd04a7a50fdf9597d1e (diff) | |
| parent | 7eb2d613c6b16c89dd06491a54b229bcbcb8dc13 (diff) | |
Merge branch 'development' of https://bitbucket.org/altafixco/next-indoteknik into development
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
Diffstat (limited to 'src-migrate/modules/cart/stores/useCartStore.ts')
| -rw-r--r-- | src-migrate/modules/cart/stores/useCartStore.ts | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src-migrate/modules/cart/stores/useCartStore.ts b/src-migrate/modules/cart/stores/useCartStore.ts index 3b50ec32..3d9a0aed 100644 --- a/src-migrate/modules/cart/stores/useCartStore.ts +++ b/src-migrate/modules/cart/stores/useCartStore.ts @@ -1,5 +1,5 @@ import { create } from 'zustand'; -import { CartItem, CartProps } from '~/types/cart'; +import { CartProps } from '~/types/cart'; import { getUserCart } from '~/services/cart'; type State = { @@ -16,7 +16,6 @@ type State = { type Action = { loadCart: (userId: number) => Promise<void>; - updateCartItem: (updateCart: CartProps) => void; }; export const useCartStore = create<State & Action>((set, get) => ({ @@ -40,15 +39,6 @@ export const useCartStore = create<State & Action>((set, get) => ({ const summary = computeSummary(cart); set({ summary }); }, - updateCartItem: (updatedCart) => { - const cart = get().cart; - if (!cart) return; - - set({ cart: updatedCart }); - const summary = computeSummary(updatedCart); - set({ summary }); - }, - })); const computeSummary = (cart: CartProps) => { |
