Skip to content

Commit

Permalink
refactor: use new scoped hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
field123 committed Apr 30, 2024
1 parent 42959eb commit 21f1e0b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/react-shopper-hooks/src/stories/Cart.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import Layout from "./components/Layout"
import { useGetCart } from "../cart/hooks/use-get-cart"
import { CartProvider, useCart } from "../cart"
import { CartItem } from "@moltin/sdk"
import { useCartUpdateItem } from "../cart/hooks/use-cart-update-item"
import { useCartRemoveItem } from "../cart/hooks/use-cart-remove-item"

const Cart = ({ showHookData, id }: { showHookData: boolean; id: string }) => {
const { data, isLoading } = useGetCart(id) // TODO add real token
Expand Down Expand Up @@ -51,11 +53,10 @@ GetOne.argTypes = {
}

function Item({ item }: { item: CartItem }) {
const { useScopedUpdateCartItem, useScopedRemoveCartItem } = useCart()
const { mutate: mutateUpdate, isPending: isUpdateItemPending } =
useScopedUpdateCartItem()
useCartUpdateItem()
const { mutate: mutateRemove, isPending: isRemovePending } =
useScopedRemoveCartItem()
useCartRemoveItem()
return (
<li key={item.id}>
{item.name} - {item.quantity} -{" "}
Expand Down

0 comments on commit 21f1e0b

Please sign in to comment.