aggio query
This commit is contained in:
@@ -38,7 +38,7 @@ router.get('/:userId', authenticate, async function (req, res, next) {
|
||||
if (cart)
|
||||
return res.send({ code: server_constants.RIS_CODE_OK, cart });
|
||||
else
|
||||
return res.send({ code: server_constants.RIS_CODE_OK, cart: null });
|
||||
return res.send({ code: server_constants.RIS_CODE_OK, cart: null });
|
||||
}).catch((err) => {
|
||||
console.error('Err', err);
|
||||
return res.send({ code: server_constants.RIS_CODE_ERR, cart: null });
|
||||
@@ -214,11 +214,14 @@ router.post('/:userId/cartstatus', authenticate, async function (req, res, next)
|
||||
created_at: new Date(),
|
||||
modify_at: new Date(),
|
||||
})
|
||||
return await OrdersCart.updateOrdersCartById(-1, newOrderCart, function (err, ris) {
|
||||
return await OrdersCart.updateOrdersCartById(-1, newOrderCart, async function (err, ris) {
|
||||
//if (err) return next(err)
|
||||
if (err)
|
||||
return res.send({ code: server_constants.RIS_CODE_ERR, status: 0 });
|
||||
else {
|
||||
|
||||
await Product.updateStatusOrders(mycart.items, status);
|
||||
|
||||
const myris = ris;
|
||||
// Cancella il Cart appena salvato in OrdersCart
|
||||
|
||||
|
||||
Reference in New Issue
Block a user