This commit is contained in:
parent
990e8ee249
commit
65756f98ad
|
@ -33,6 +33,11 @@ module.exports = Self => {
|
|||
}
|
||||
|
||||
try {
|
||||
const dmsTypeCmr = await models.DmsType.findOne({
|
||||
where: {code: 'cmr'},
|
||||
fields: ['id']
|
||||
}, 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);
|
||||
|
|
Loading…
Reference in New Issue