mirror of
https://github.com/vercel/commerce.git
synced 2025-05-18 15:36:58 +00:00
Hearts now work again
This commit is contained in:
parent
4ca580983a
commit
8d8f779e24
@ -31,8 +31,8 @@ const WishlistButton: FC<Props> = ({
|
|||||||
const itemInWishlist = data?.items?.find(
|
const itemInWishlist = data?.items?.find(
|
||||||
// @ts-ignore Wishlist is not always enabled
|
// @ts-ignore Wishlist is not always enabled
|
||||||
(item) =>
|
(item) =>
|
||||||
item.product_id === productId &&
|
item.product_id === Number(productId) &&
|
||||||
item.variant_id === variant.id
|
item.variant_id === Number(variant.id)
|
||||||
)
|
)
|
||||||
|
|
||||||
const handleWishlistChange = async (e: any) => {
|
const handleWishlistChange = async (e: any) => {
|
||||||
|
@ -13,13 +13,11 @@ import useAddItem from '@framework/cart/use-add-item'
|
|||||||
import useRemoveItem from '@framework/wishlist/use-remove-item'
|
import useRemoveItem from '@framework/wishlist/use-remove-item'
|
||||||
import type { Wishlist } from '@commerce/types/wishlist'
|
import type { Wishlist } from '@commerce/types/wishlist'
|
||||||
|
|
||||||
interface Props {
|
|
||||||
item: Wishlist
|
|
||||||
}
|
|
||||||
|
|
||||||
const placeholderImg = '/product-img-placeholder.svg'
|
const placeholderImg = '/product-img-placeholder.svg'
|
||||||
|
|
||||||
const WishlistCard: FC<Props> = ({ item }) => {
|
const WishlistCard: React.FC<{
|
||||||
|
item: Wishlist
|
||||||
|
}> = ({ item }) => {
|
||||||
const product: Product = item.product
|
const product: Product = item.product
|
||||||
const { price } = usePrice({
|
const { price } = usePrice({
|
||||||
amount: product.price?.value,
|
amount: product.price?.value,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user