You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The addItemOrUpdateItemQuantity API assumes that a user always has a cart.
If the user has no cart yet, the API throws an error when trying to access cart.items
To Reproduce
Ensure the user has no cart in the database.
Call the Add Item to Cart API.
Observe the error: Cannot read property 'items' of null.
Expected behavior
If the user does not have a cart, a new cart should be created automatically and the product should be added successfully.