refs #6184 Added cmrFk in ticket model
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Guillermo Bonet 2023-10-11 12:20:30 +02:00
parent d9339af87e
commit c0089b1fa0
2 changed files with 8 additions and 7 deletions

View File

@ -1,8 +1,6 @@
const UserError = require('vn-loopback/util/user-error');
module.exports = Self => { module.exports = Self => {
Self.remoteMethodCtx('saveCmr', { Self.remoteMethodCtx('saveCmr', {
description: 'Save sign', description: 'Save cmr',
accessType: 'WRITE', accessType: 'WRITE',
accepts: accepts:
[ [
@ -34,10 +32,10 @@ module.exports = Self => {
try { try {
for (const ticketId of tickets) { for (const ticketId of tickets) {
const cmrFk = await models.Ticket.findOne( const cmrFk = await models.Ticket.findOne({
{where: {id: ticketId}, where: {id: ticketId},
fields: ['cmrFk'] fields: ['cmrFk']
}, myOptions); }, myOptions);
if (cmrFk) { if (cmrFk) {
const dmsTypeCmr = await models.DmsType.findOne({ const dmsTypeCmr = await models.DmsType.findOne({

View File

@ -63,6 +63,9 @@
}, },
"weight": { "weight": {
"type": "number" "type": "number"
},
"cmrFk": {
"type": "number"
} }
}, },
"relations": { "relations": {