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) {