From b87e79b9d3f5ffad09f70b6975a7710d752addbd Mon Sep 17 00:00:00 2001 From: joan Date: Tue, 18 May 2021 10:05:13 +0200 Subject: [PATCH] Changes --- .../back/methods/sales-monitor/deleteOrders.js | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/modules/monitor/back/methods/sales-monitor/deleteOrders.js b/modules/monitor/back/methods/sales-monitor/deleteOrders.js index 11fbf2c35..15a8d862a 100644 --- a/modules/monitor/back/methods/sales-monitor/deleteOrders.js +++ b/modules/monitor/back/methods/sales-monitor/deleteOrders.js @@ -21,22 +21,13 @@ module.exports = Self => { Self.deleteOrders = async(deletes, options) => { const models = Self.app.models; - let tx; let myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); - try { - const deleted = models.Order.destroyAll({ - id: {inq: deletes} - }, myOptions); - - if (tx) await tx.commit(); - return deleted; - } catch (e) { - if (tx) await tx.rollback(); - throw e; - } + return models.Order.destroyAll({ + id: {inq: deletes} + }, myOptions); }; };