refs #6184 saveCmr #1788

Merged
guillermo merged 58 commits from 6184-saveCmr into dev 2024-02-13 06:47:06 +00:00
1 changed files with 6 additions and 4 deletions
Showing only changes of commit 65756f98ad - Show all commits

View File

@ -33,6 +33,11 @@ module.exports = Self => {
}
try {
const dmsTypeCmr = await models.DmsType.findOne({
where: {code: 'cmr'},
fields: ['id']
guillermo marked this conversation as resolved Outdated

Este el cree cada vegada pero es el mateix id per a tots. Pujal fora del for
El nom jo posaría dmsTypeCmr

Este el cree cada vegada pero es el mateix id per a tots. Pujal fora del for El nom jo posaría dmsTypeCmr
}, myOptions);
for (const ticketId of tickets) {
const ticket = await models.Ticket.findById(ticketId, myOptions);
@ -43,10 +48,7 @@ module.exports = Self => {
relation: 'dms',
fields: ['dmsFk'],
scope: {
relation: 'dmsType',
scope: {
where: {code: 'cmr'}
}
where: {dmsTypeFk: dmsTypeCmr.id}
}
}
}, myOptions);