@ministryofjustice/hmpps-digital-prison-reporting-frontend
Version:
The Digital Prison Reporting Frontend contains templates and code to help display data effectively in UI applications.
28 lines (24 loc) • 1.09 kB
JavaScript
;
var express = require('express');
var controller = require('./controller.js');
var routes = require('./request-download/routes.js');
/* eslint-disable no-param-reassign */
function Routes({ layoutPath, services }) {
const router = express.Router({ mergeParams: true });
const controller$1 = new controller.DownloadReportController(layoutPath, services);
// Download report
router.post(['/:reportId/:id/tableId/:tableId', '/:reportId/:id'], controller$1.POST);
// Request download form routes
router.use([`/request-download/:reportId/:variantId/tableId/:tableId`, `/request-download/:reportId/:variantId`], routes.default({ layoutPath, services }));
return router;
}
const DownloadReportRoutes = ({ services, path, layoutPath, }) => {
const router = express.Router({ mergeParams: true });
if (services.downloadPermissionService.enabled) {
router.use(path, Routes({ services, layoutPath }));
}
return router;
};
exports.DownloadReportRoutes = DownloadReportRoutes;
exports.Routes = Routes;
//# sourceMappingURL=routes.js.map