automate-sales / automate-commerce

next js ecommerce
MIT License
0 stars 0 forks source link

Add refresh in cart when item is deleted #58

Closed NitinCraziino closed 4 months ago

NitinCraziino commented 4 months ago

Add refresh in cart when item is deleted Fix cart delete feature

Covered these two issues in this PR

gkpty commented 4 months ago

There is weird behavior with the delete action in the cart. It doesn't display any alert because it triggers the router.refresh functionality.

something should be done so that either:

  1. the toast container is outside of the scope of page refresh, i think a global cache provider like redux or react context will be needed for this
  2. the cart is refreshed without refreshing the page. A function can be called that sets a state variable cartItems.

It is critical that the alerts get displayed correctly when users carry out some kind of action in the cart.