4
0
forked from crowetic/commerce

fix: Render item in wishlist properly if ID is a string (#647)

This commit is contained in:
Alessandro Casazza 2022-01-16 14:58:26 +01:00 committed by GitHub
parent a6babd93d5
commit de24bd041c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,8 +31,8 @@ const WishlistButton: FC<Props> = ({
const itemInWishlist = data?.items?.find(
// @ts-ignore Wishlist is not always enabled
(item) =>
item.product_id === Number(productId) &&
(item.variant_id as any) === Number(variant.id)
item.product_id === productId &&
item.variant_id === variant.id
)
const handleWishlistChange = async (e: any) => {