fix: refs #6184 saveSign
gitea/salix/pipeline/pr-test This commit looks good Details

This commit is contained in:
Guillermo Bonet 2024-02-26 13:57:07 +01:00
parent c1c64d0f89
commit a4419a2542
2 changed files with 3 additions and 2 deletions

View File

@ -57,7 +57,7 @@ module.exports = Self => {
AND dt.code = 'cmr'
`, [ticketId]);
if (!dms.lenght) throw new UserError('Cmr file does not exist');
if (!dms.length) throw new UserError('Cmr file does not exist');
const response = await models.Dms.downloadFile(ctx, dms[0].id);

View File

@ -134,7 +134,8 @@ module.exports = Self => {
if (location) await setLocation(ticketId);
if (!await hasSignDms(ticketId) && !isSignUploaded)
await createGestDoc(ticketId);
await models.TicketDms.create({ticketFk: ticket.id, dmsFk: dms[0].id}, myOptions);
if (isSignUploaded)
await models.TicketDms.create({ticketFk: ticket.id, dmsFk: dms[0].id}, myOptions);
await ticket.updateAttribute('isSigned', true, myOptions);
const deliveryState = await models.State.findOne({