#2913, #2914 - Changes to sales monitors #624

Merged
carlosjr merged 5 commits from 2913-monitor_changes into dev 2021-05-18 08:29:32 +00:00
1 changed files with 3 additions and 12 deletions
Showing only changes of commit 400bf7b4f2 - Show all commits

View File

@ -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({
return models.Order.destroyAll({
id: {inq: deletes}
}, myOptions);
if (tx) await tx.commit();
return deleted;
} catch (e) {
if (tx) await tx.rollback();
throw e;
}
};
};