From 9c0af7f7c6be825edcb1f04359c5d7f911d17df1 Mon Sep 17 00:00:00 2001 From: guillermo Date: Thu, 14 Nov 2024 07:57:13 +0100 Subject: [PATCH] refactor: refs #7950 Requested changes --- loopback/common/methods/vn-model/printService.js | 2 +- modules/ticket/back/methods/ticket/saveCmr.js | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/loopback/common/methods/vn-model/printService.js b/loopback/common/methods/vn-model/printService.js index 12a6a67cc..ed784229b 100644 --- a/loopback/common/methods/vn-model/printService.js +++ b/loopback/common/methods/vn-model/printService.js @@ -2,7 +2,7 @@ const {Report, Email} = require('vn-print'); module.exports = Self => { Self.printReport = async function(ctx, id, reportName) { - const args = Object.assign({}, ctx.args); + const args = Object.assign({id}, ctx.args); const params = {lang: ctx.req.getLocale()}; delete args.ctx; diff --git a/modules/ticket/back/methods/ticket/saveCmr.js b/modules/ticket/back/methods/ticket/saveCmr.js index a96bb6a27..5ac748751 100644 --- a/modules/ticket/back/methods/ticket/saveCmr.js +++ b/modules/ticket/back/methods/ticket/saveCmr.js @@ -53,8 +53,7 @@ module.exports = Self => { if (hasDmsCmr.length) throw new UserError('This ticket already has a cmr saved'); - Object.assign(ctx.args, {id: ticket.$cmrFk}); - const response = await models.Cmr.print(ctx, myOptions); + const response = await models.Cmr.print(ctx, ticket.$cmrFk, myOptions); const pdfStream = Readable.from(Buffer.from(response[0])); const data = { workerFk: ctx.req.accessToken.userId,