lista ordini aggiornata
This commit is contained in:
@@ -224,7 +224,8 @@ router.post('/:userId/createorderscart', authenticate, async function (req, res,
|
||||
try {
|
||||
const mycart = await Cart.findOne({ _id: cart_id });
|
||||
|
||||
let numorder = await OrdersCart.getLastNumOrder(userId, idapp);
|
||||
let numorder = await OrdersCart.getLastNumOrder(idapp);
|
||||
let numord_pers = await OrdersCart.getLastNumOrdPers(userId, idapp);
|
||||
|
||||
// Esiste l'ordine ?
|
||||
let myorderCart = await OrdersCart.getRecCartByUserId(userId, idapp, numorder);
|
||||
@@ -232,6 +233,7 @@ router.post('/:userId/createorderscart', authenticate, async function (req, res,
|
||||
|
||||
// crea il nuovo numero d'ordine
|
||||
numorder++;
|
||||
numord_pers++;
|
||||
|
||||
// SE non esiste allora lo creo !
|
||||
myorderCart = new OrdersCart({
|
||||
@@ -243,6 +245,7 @@ router.post('/:userId/createorderscart', authenticate, async function (req, res,
|
||||
status,
|
||||
note,
|
||||
numorder,
|
||||
numord_pers,
|
||||
created_at: new Date(),
|
||||
modify_at: new Date(),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user