Archived
2

Merge pull request #28 in ~VLE2FE/definma-api from develop to master

* commit '2c57d2045c666dc7a3a3a4b6bf8d7baebfee45f5':
  csv fix
This commit is contained in:
Veit Lukas (PEA4-Fe) 2020-08-10 17:18:24 +02:00
commit 2250566287

View File

@ -400,6 +400,7 @@ router.get('/samples', async (req, res, next) => {
csv(_.compact(data.map(e => SampleValidate.output(e, 'refs', measurementFields))), (err, data) => { csv(_.compact(data.map(e => SampleValidate.output(e, 'refs', measurementFields))), (err, data) => {
if (err) return next(err); if (err) return next(err);
res.set('Content-Type', 'text/csv'); res.set('Content-Type', 'text/csv');
res.set('Content-Disposition', 'attachment; filename="samples.csv"');
res.send(data); res.send(data);
}); });
} }