@ministryofjustice/hmpps-digital-prison-reporting-frontend
Version:
The Digital Prison Reporting Frontend contains templates and code to help display data effectively in UI applications.
19 lines (14 loc) • 673 B
text/typescript
/* eslint-disable no-param-reassign */
import { Router } from 'express'
import { Services } from '../../../../types/Services'
// Routes
import loadReportRoutes from './load-report/routes'
import viewReportRoutes from './report/routes'
// middleware
import reportAuthoriser from '../../../../middleware/reportAuthoriser'
export default function routes({ layoutPath, services }: { layoutPath: string; services: Services }) {
const router = Router({ mergeParams: true })
router.use('/report', reportAuthoriser(services, layoutPath), viewReportRoutes({ layoutPath, services }))
router.use(`/load-report`, loadReportRoutes({ layoutPath, services }))
return router
}