From 6c8e952d9e5c022bff193b509ce5ec7c67ccfc71 Mon Sep 17 00:00:00 2001 From: Michal Hoffman Date: Thu, 11 May 2023 16:29:37 +0100 Subject: [PATCH] fix: adding one unit of a product to cart --- src/features/product/components/Product.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/product/components/Product.tsx b/src/features/product/components/Product.tsx index fbbafc9..315ef79 100644 --- a/src/features/product/components/Product.tsx +++ b/src/features/product/components/Product.tsx @@ -35,7 +35,7 @@ const Product: React.FC = () => { const addToCart = () => { if (productToShow) { - cartService.addProductToCart(productToShow); + cartService.addProductToCart({...productToShow, quantity: 1}); } };