fix: modelo incorrecto
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
bca79e1240
commit
af87fc2d53
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue