CUD operations on reports and report templates seem to work
Execution of reports is TBD
This commit is contained in:
parent
38cf3e49c0
commit
6d95fa515e
18 changed files with 273 additions and 46 deletions
14
routes/rest/campaigns.js
Normal file
14
routes/rest/campaigns.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
'use strict';
|
||||
|
||||
const passport = require('../../lib/passport');
|
||||
const campaigns = require('../../models/campaigns');
|
||||
|
||||
const router = require('../../lib/router-async').create();
|
||||
|
||||
|
||||
router.postAsync('/campaigns-table', passport.loggedIn, async (req, res) => {
|
||||
return res.json(await campaigns.listDTAjax(req.body));
|
||||
});
|
||||
|
||||
|
||||
module.exports = router;
|
14
routes/rest/lists.js
Normal file
14
routes/rest/lists.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
'use strict';
|
||||
|
||||
const passport = require('../../lib/passport');
|
||||
const lists = require('../../models/lists');
|
||||
|
||||
const router = require('../../lib/router-async').create();
|
||||
|
||||
|
||||
router.postAsync('/lists-table', passport.loggedIn, async (req, res) => {
|
||||
return res.json(await lists.listDTAjax(req.body));
|
||||
});
|
||||
|
||||
|
||||
module.exports = router;
|
|
@ -35,5 +35,10 @@ router.postAsync('/report-templates-table', passport.loggedIn, async (req, res)
|
|||
return res.json(await reportTemplates.listDTAjax(req.body));
|
||||
});
|
||||
|
||||
router.getAsync('/report-template-user-fields/:reportTemplateId', passport.loggedIn, async (req, res) => {
|
||||
const userFields = await reportTemplates.getUserFieldsById(req.params.reportTemplateId);
|
||||
return res.json(userFields);
|
||||
});
|
||||
|
||||
|
||||
module.exports = router;
|
|
@ -9,7 +9,7 @@ const router = require('../../lib/router-async').create();
|
|||
|
||||
|
||||
router.getAsync('/reports/:reportId', passport.loggedIn, async (req, res) => {
|
||||
const report = await reports.getById(req.params.reportId);
|
||||
const report = await reports.getByIdWithUserFields(req.params.reportId);
|
||||
report.hash = reports.hash(report);
|
||||
return res.json(report);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue