diff --git a/modules/ticket/back/methods/ticket/saveCmr.js b/modules/ticket/back/methods/ticket/saveCmr.js index 5df4d8ae7..06dc5b7fb 100644 --- a/modules/ticket/back/methods/ticket/saveCmr.js +++ b/modules/ticket/back/methods/ticket/saveCmr.js @@ -1,8 +1,6 @@ -const UserError = require('vn-loopback/util/user-error'); - module.exports = Self => { Self.remoteMethodCtx('saveCmr', { - description: 'Save sign', + description: 'Save cmr', accessType: 'WRITE', accepts: [ @@ -34,10 +32,10 @@ module.exports = Self => { try { for (const ticketId of tickets) { - const cmrFk = await models.Ticket.findOne( - {where: {id: ticketId}, - fields: ['cmrFk'] - }, myOptions); + const cmrFk = await models.Ticket.findOne({ + where: {id: ticketId}, + fields: ['cmrFk'] + }, myOptions); if (cmrFk) { const dmsTypeCmr = await models.DmsType.findOne({ diff --git a/modules/ticket/back/models/ticket.json b/modules/ticket/back/models/ticket.json index ec4193bed..b5f2b5ed9 100644 --- a/modules/ticket/back/models/ticket.json +++ b/modules/ticket/back/models/ticket.json @@ -63,6 +63,9 @@ }, "weight": { "type": "number" + }, + "cmrFk": { + "type": "number" } }, "relations": {