Aggiornamento modifiche preOrdini

This commit is contained in:
Surya Paolo
2023-12-20 21:52:17 +01:00
parent 56b5bac5f0
commit 0e1fc359a0
11 changed files with 290 additions and 61 deletions

View File

@@ -30,14 +30,15 @@ const OrdersCart = require('../models/orderscart');
router.get('/:userId', authenticate, function (req, res, next) {
let userId = req.body.userId
let idapp = req.body.idapp
OrdersCart.getOrdersCartByUserId(userId, idapp, 0, function (err, cart) {
if (err) return next(err)
OrdersCart.getOrdersCartByUserId(userId, idapp, 0, false)
.then((cart) => {
if (cart)
res.send({ code: server_constants.RIS_CODE_OK, cart });
else
res.status(400).send(e);
})
if (cart)
res.send({ code: server_constants.RIS_CODE_OK, cart });
else
res.status(400).send(e);
})
})
module.exports = router;