|
@@ -85,6 +85,10 @@ const mutations = {
|
|
|
[PULL_FROM_CART] (state, payload) {
|
|
|
let productFoundIndex = state.cartItems.findIndex(item => item.id === payload.item.id)
|
|
|
|
|
|
+ if (state.cartItems[productFoundIndex].quantity === 1) {
|
|
|
+ payload.mode = 'full'
|
|
|
+ }
|
|
|
+
|
|
|
if (payload.mode === 'partial') {
|
|
|
state.cartItems[productFoundIndex].quantity = state.cartItems[productFoundIndex].quantity - 1
|
|
|
} else {
|