refs #6184 Insert in ticketCmr
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Guillermo Bonet 2023-10-11 11:46:56 +02:00
parent 3e522b08b6
commit d9339af87e
1 changed files with 3 additions and 2 deletions

View File

@ -22,7 +22,7 @@ module.exports = Self => {
Self.saveCmr = async(ctx, tickets, options) => {
const models = Self.app.models;
const myOptions = {userId: ctx.req.accessToken.userId};
let tx;
let tx, dms;
if (typeof options == 'object')
Object.assign(myOptions, options);
@ -68,7 +68,8 @@ module.exports = Self => {
description: `Documento comprimido - CMR ${cmrFk}`,
hasFile: false
};
await models.Dms.uploadFile(ctxUploadFile, myOptions);
dms = await models.Dms.uploadFile(ctxUploadFile, myOptions);
await models.TicketDms.create({ticketFk: ticketId, dmsFk: dms[0].id}, myOptions);
}
}
}