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 3 additions and 2 deletions
Showing only changes of commit d9339af87e - Show all commits

View File

@ -22,7 +22,7 @@ module.exports = Self => {
Self.saveCmr = async(ctx, tickets, options) => { Self.saveCmr = async(ctx, tickets, options) => {
const models = Self.app.models; const models = Self.app.models;
const myOptions = {userId: ctx.req.accessToken.userId}; const myOptions = {userId: ctx.req.accessToken.userId};
let tx; let tx, dms;
if (typeof options == 'object') if (typeof options == 'object')
Object.assign(myOptions, options); Object.assign(myOptions, options);
@ -68,7 +68,8 @@ module.exports = Self => {
description: `Documento comprimido - CMR ${cmrFk}`, description: `Documento comprimido - CMR ${cmrFk}`,
hasFile: false 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);
} }
} }
} }