Fixed product types

This commit is contained in:
Luis Alvarez
2021-02-15 10:15:20 -05:00
parent c636fcbc4b
commit 62ed50a646
13 changed files with 70 additions and 85 deletions

View File

@@ -8,6 +8,7 @@ import { useUI } from '@components/ui'
import { Swatch, ProductSlider } from '@components/product'
import { Button, Container, Text } from '@components/ui'
import type { Product } from '@commerce/types'
import usePrice from '@framework/product/use-price'
import { useAddItem } from '@framework/cart'
@@ -41,7 +42,7 @@ const ProductView: FC<Props> = ({ product }) => {
setLoading(true)
try {
await addItem({
productId: product.id,
productId: String(product.id),
variantId: variant ? variant.id : product.variants[0].id,
})
openSidebar()