fix: refs #6184 saveSign

This commit is contained in:
Guillermo Bonet 2024-02-26 13:00:35 +01:00
parent a359ace1b8
commit 817f685621
1 changed files with 5 additions and 5 deletions

View File

@ -65,7 +65,7 @@ module.exports = Self => {
JOIN dms d ON d.id = td.dmsFk JOIN dms d ON d.id = td.dmsFk
WHERE td.ticketFk = ? WHERE td.ticketFk = ?
AND d.dmsTypeFk = ? AND d.dmsTypeFk = ?
`, [ticketId, dmsTypeTicket.id]); `, [ticketId, dmsTypeTicket.id], myOptions);
if (hasTicketDms.length) return true; if (hasTicketDms.length) return true;
} }
@ -108,17 +108,17 @@ module.exports = Self => {
fields: ['id'] fields: ['id']
} }
}] }]
}); }, myOptions);
const ticketState = await models.TicketState.findOne({ const ticketState = await models.TicketState.findOne({
where: {ticketFk: ticketId}, where: {ticketFk: ticketId},
fields: ['alertLevel'] fields: ['alertLevel']
}); }, myOptions);
const packedAlertLevel = await models.AlertLevel.findOne({ const packedAlertLevel = await models.AlertLevel.findOne({
where: {code: 'PACKED'}, where: {code: 'PACKED'},
fields: ['id'] fields: ['id']
}); }, myOptions);
if (!ticketState) if (!ticketState)
throw new UserError('Ticket does not exist'); throw new UserError('Ticket does not exist');
@ -135,7 +135,7 @@ module.exports = Self => {
const deliveryState = await models.State.findOne({ const deliveryState = await models.State.findOne({
where: {code: 'DELIVERED'} where: {code: 'DELIVERED'}
}); }, myOptions);
await models.Ticket.state(ctx, { await models.Ticket.state(ctx, {
ticketFk: ticketId, ticketFk: ticketId,