remove file

This commit is contained in:
Vicent Llopis 2023-07-21 12:01:57 +02:00
parent cf0b6f8c6e
commit 51f9055d23
1 changed files with 0 additions and 49 deletions

View File

@ -1,49 +0,0 @@
module.exports = Self => {
Self.remoteMethod('deleteSaleGroupDetail', {
description: 'Elimina los registros de saleGroupDetail',
accessType: 'WRITE',
accepts: [
{
arg: 'saleFk',
type: 'number',
description: 'The sale id'
}
],
returns: {
type: ['object'],
root: true
},
http: {
path: `/deleteSaleGroupDetail`,
verb: 'POST'
}
});
Self.deleteSaleGroupDetail = async(saleFk, options) => {
const models = Self.app.models;
const myOptions = {};
let tx;
if (typeof options == 'object')
Object.assign(myOptions, options);
if (!myOptions.transaction) {
tx = await Self.beginTransaction({});
myOptions.transaction = tx;
}
try {
const deletes = await models.SaleGroupDetail.destroyAll({
saleFk: saleFk
}, myOptions);
if (tx) await tx.commit();
return deletes;
} catch (e) {
if (tx) await tx.rollback();
throw e;
}
};
};