Corretto incongruenze OrdersCart
This commit is contained in:
@@ -90,11 +90,13 @@ router.post('/:userId', authenticate, async function (req, res, next) {
|
||||
myord = await newCart.subqty(order);
|
||||
} else {
|
||||
const ind = newCart.addItem(order);
|
||||
myord = order;
|
||||
const arrord = await Order.getTotalOrderById(order._id);
|
||||
myord = arrord ? arrord[0] : null;
|
||||
}
|
||||
} else {
|
||||
await newCart.updatetotals();
|
||||
myord = order;
|
||||
const arrord = await Order.getTotalOrderById(order._id);
|
||||
myord = arrord ? arrord[0] : null;
|
||||
}
|
||||
cart = await Cart.updateCartByCartId(mycart._id, newCart.generateModel());
|
||||
|
||||
@@ -311,6 +313,15 @@ router.post('/:userId/createorderscart', authenticate, async function (req, res,
|
||||
})
|
||||
}
|
||||
})
|
||||
} else if (status < shared_consts.OrderStatus.CHECKOUT_SENT) {
|
||||
// Aggiorna il carrello !
|
||||
|
||||
/*const cartpao = await Cart.getCartByUserId(userId, idapp);
|
||||
let newCart = CartClass.constructByCart(cartpao);
|
||||
if (newCart)
|
||||
await newCart.updatetotals();
|
||||
newCart;*/
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user