Changes
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
5d278f416f
commit
400bf7b4f2
|
@ -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);
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue