Added the option to select lists in report.

Added an option to generate a CSV report.
This commit is contained in:
Tomas Bures 2017-04-17 16:30:31 -04:00
parent 6ba04d7ff4
commit 2056645023
8 changed files with 177 additions and 50 deletions

View file

@ -748,4 +748,27 @@ router.get('/subscription/:id/import/:importId/failed', (req, res) => {
});
});
router.post('/quicklist/ajax', (req, res) => {
lists.filterQuicklist(req.body, (err, data, total, filteredTotal) => {
if (err) {
return res.json({
error: err.message || err,
data: []
});
}
res.json({
draw: req.body.draw,
recordsTotal: total,
recordsFiltered: filteredTotal,
data: data.map((row, i) => ({
"0": (Number(req.body.start) || 0) + 1 + i,
"1": '<span class="glyphicon glyphicon-inbox" aria-hidden="true"></span> <a href="/lists/view/' + row.id + '">' + htmlescape(row.name || '') + '</a>',
"2": row.subscribers,
"DT_RowId": row.id
}))
});
});
});
module.exports = router;