diff --git a/src/libs/middlewares/response.js b/src/libs/middlewares/response.js index 580c16f5bd7470d20c622565954234f873f56b54..cb2f4ca3a14bf9b2240ce1ebeeec3e89c05746c4 100644 --- a/src/libs/middlewares/response.js +++ b/src/libs/middlewares/response.js @@ -12,7 +12,7 @@ function response(value) { res.attachment(`${value}.csv`); res.csv(req.result); } else if (req.query.format === 'xml') { - res.send(xml('result', JSON.stringify({ [value]: req.result }))); + res.send(xml.parse('result', { [value]: req.result })); } else { res.json({ result: req.result }); }