UNPKG

@ministryofjustice/hmpps-digital-prison-reporting-frontend

Version:

The Digital Prison Reporting Frontend contains templates and code to help display data effectively in UI applications.

32 lines (25 loc) 816 B
/* eslint-disable no-param-reassign */ import { Router } from 'express' // Routes import formRoutes from './form/routes' import submittedRoutes from './submitted/routes' import { Services } from '../../../types/Services' export function Routes({ layoutPath, services }: { services: Services; layoutPath: string }) { const router = Router({ mergeParams: true }) router.use(`/:reportId/:variantId/submitted`, submittedRoutes({ layoutPath })) router.use(`/:reportId/:variantId/form`, formRoutes({ layoutPath, services })) return router } export const RequestMissingReportRoutes = ({ services, path, layoutPath, }: { services: Services path: string layoutPath: string }) => { const router = Router({ mergeParams: true }) router.use(path, Routes({ services, layoutPath })) return router }