diff options
| author | Mateja <mail@matejamaric.com> | 2021-07-25 16:45:55 +0200 | 
|---|---|---|
| committer | Mateja <mail@matejamaric.com> | 2021-07-25 16:45:55 +0200 | 
| commit | ba0dfd3622d5a72b07fc1085b235383b20a6f9b1 (patch) | |
| tree | a5bcfaafbefeb266492705ecd05b12a1d796d6f0 /client/src/store | |
| parent | 73751eff7688ec9994c098ba95f1c08fad210e31 (diff) | |
| download | mevn-ecommerce-ba0dfd3622d5a72b07fc1085b235383b20a6f9b1.tar.gz mevn-ecommerce-ba0dfd3622d5a72b07fc1085b235383b20a6f9b1.zip  | |
Allow product removal on Checkout page.
Diffstat (limited to 'client/src/store')
| -rw-r--r-- | client/src/store/index.js | 4 | 
1 files changed, 2 insertions, 2 deletions
diff --git a/client/src/store/index.js b/client/src/store/index.js index 086c544..519347d 100644 --- a/client/src/store/index.js +++ b/client/src/store/index.js @@ -58,8 +58,8 @@ export default createStore({            quantity: 1          });      }, -    removeFromCart(state) { -      let foundProduct = state.cart.find(x => x.id == state.currentProduct._id); +    removeFromCart(state, productId) { +      let foundProduct = state.cart.find(x => x.id == productId);        if (foundProduct) {          foundProduct.quantity--;          if (foundProduct.quantity == 0)  | 
