4
0
forked from crowetic/commerce

Normalizing more operations

This commit is contained in:
Belen Curcio 2021-01-10 16:25:25 -03:00
parent def1cf0778
commit 1742ae8ea6
2 changed files with 4 additions and 4 deletions

View File

@ -25,7 +25,7 @@ const ProductCard: FC<Props> = ({ className, product, variant, imgProps }) => {
{product.name}
</span>
</div>
{product.images[0] && (
{product.images?[0] && (
<Image
quality="85"
alt={product.name}
@ -54,11 +54,11 @@ const ProductCard: FC<Props> = ({ className, product, variant, imgProps }) => {
<WishlistButton
className={s.wishlistButton}
productId={product.id}
variant={product.variants[0]!}
variant={product.variants?[0]}
/>
</div>
<div className={s.imageContainer}>
{product.images[0] && (
{product.images?[0] && (
<Image
alt={product.name}
className={s.productImage}

View File

@ -9,7 +9,7 @@ interface Product extends Entity {
slug: string
path?: string
images: ProductImage[] | any[] | undefined
variants: ProductVariant[] | any[] | undefined
variants: ProductVariant[] | any[] | null | undefined
price: ProductPrice
}
interface ProductImage {