From ba3a52d7bb513d92318851f0e1bdfa40570ca31d Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Wed, 3 Jun 2020 18:06:30 +0200 Subject: [PATCH] Fixed request args --- print/methods/closure.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/print/methods/closure.js b/print/methods/closure.js index 931ebac4a..c947a0468 100644 --- a/print/methods/closure.js +++ b/print/methods/closure.js @@ -4,11 +4,11 @@ const smtp = require('../core/smtp'); const config = require('../core/config'); module.exports = app => { - app.get('/api/closure/by-ticket', async function(request, response) { + app.get('/api/closure/by-ticket', async function(req, res) { }); - app.get('/api/closure/all', async function(request, response) { - response.status(200).json({ + app.get('/api/closure/all', async function(req, res) { + res.status(200).json({ message: 'Task executed successfully' }); @@ -54,11 +54,13 @@ module.exports = app => { continue; } - const args = { + const reqArgs = req.args; + const args = Object.assign({ ticketId: ticket.id, recipientId: ticket.clientFk, recipient: ticket.recipient - }; + }, reqArgs); + const email = new Email('delivery-note-link', args); await email.send(); } catch (error) {