diff --git a/modules/ticket/back/methods/ticket-log/getChanges.js b/modules/ticket/back/methods/ticket-log/getChanges.js index a025bac05..bb40a66d8 100644 --- a/modules/ticket/back/methods/ticket-log/getChanges.js +++ b/modules/ticket/back/methods/ticket-log/getChanges.js @@ -1,6 +1,6 @@ module.exports = Self => { Self.remoteMethodCtx('getChanges', { - description: 'Check if a ticket is editable', + description: 'Get changues in the sales of a ticket', accessType: 'READ', accepts: [{ arg: 'id', @@ -39,8 +39,8 @@ module.exports = Self => { const newQuantity = ticketLog.newInstance ? ticketLog.newInstance.quantity : null; if (ticketLog.changedModel == 'Sale' && isUpdate && ticketLog.newInstance.quantity) { - const item = await models.Item.findById(ticketLog.changedModelId, null, myOptions); - changes.push(`${item.name} cambia de ${oldQuantity} a ${newQuantity}`); + const sale = await models.Sale.findById(ticketLog.changedModelId, null, myOptions); + changes.push(`${sale.concept} cambia de ${oldQuantity} a ${newQuantity}`); } if (ticketLog.changedModel == 'Ticket' && isUpdate && ticketLog.newInstance.quantity)