adrianhajdin / ecommerce_sanity_stripe

Modern Full Stack ECommerce Application with Stripe
https://jsmastery.pro
2.21k stars 674 forks source link

Received NaN for the `children` attribute when decreasing qty of cart items #31

Open Deni-ux opened 2 years ago

Deni-ux commented 2 years ago

Hi! when I try to decrement the qty of a cart item I receive NaN. I couldn't figure out the bug after hours of trying. This is my code. Please let me know how I can fix it. Thank you. code code1

MAKAR190 commented 2 years ago

Hi, maybe because when you are trying to decrement, you are writing quantity: foundProduct - 1 instead of quantity: foundProduct.quantity - 1