From af87fc2d53df1ae642556144d5026ea2e900c716 Mon Sep 17 00:00:00 2001 From: vicent Date: Fri, 25 Nov 2022 11:51:07 +0100 Subject: [PATCH] fix: modelo incorrecto --- modules/ticket/back/methods/ticket-log/getChanges.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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)