Skip to content

Commit

Permalink
PI-1939 - refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
achimber-moj committed Mar 25, 2024
1 parent 30e64ac commit 1bad570
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions server/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import startRoutes from './start'
import searchRoutes from './search'
import caseRoutes from './case'
import personalDetailRoutes from './personalDetails'
import sentenceDetailRoutes from './sentenceDetails'
import sentenceRoutes from './sentence'
import scheduleRoutes from './schedule'

export default function routes(services: Services): Router {
Expand All @@ -15,7 +15,7 @@ export default function routes(services: Services): Router {
searchRoutes(router, services)
caseRoutes(router, services)
personalDetailRoutes(router, services)
sentenceDetailRoutes(router, services)
sentenceRoutes(router, services)
scheduleRoutes(router, services)
return router
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import asyncMiddleware from '../middleware/asyncMiddleware'
import type { Services } from '../services'
import MasApiClient from '../data/masApiClient'

export default function sentenceDetailRoutes(router: Router, { hmppsAuthClient }: Services) {
export default function sentenceRoutes(router: Router, { hmppsAuthClient }: Services) {
const get = (path: string | string[], handler: RequestHandler) => router.get(path, asyncMiddleware(handler))

get('/case/:crn/sentence', async (req, res, _next) => {
Expand All @@ -23,7 +23,7 @@ export default function sentenceDetailRoutes(router: Router, { hmppsAuthClient }
})

const sentenceDetails = await masClient.getSentenceDetails(crn)
res.render('pages/sentence-details', {
res.render('pages/sentence', {
sentenceDetails,
crn,
})
Expand Down
File renamed without changes.

0 comments on commit 1bad570

Please sign in to comment.