diff --git a/modules/ticket/back/methods/sale-tracking/deleteSaleGroupDetail.js b/modules/ticket/back/methods/sale-tracking/deleteSaleGroupDetail.js deleted file mode 100644 index 13806edf0..000000000 --- a/modules/ticket/back/methods/sale-tracking/deleteSaleGroupDetail.js +++ /dev/null @@ -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; - } - }; -};