refs #6184 saveCmr #1788

Merged
guillermo merged 58 commits from 6184-saveCmr into dev 2024-02-13 06:47:06 +00:00
2 changed files with 8 additions and 7 deletions
Showing only changes of commit c0089b1fa0 - Show all commits

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": {