From 9f5808f5a5768ba9ea1878d55d12a770f5f807a3 Mon Sep 17 00:00:00 2001 From: Daniel Liburd Date: Thu, 30 Jan 2025 14:39:57 +0000 Subject: [PATCH] Introduce findByCrn path and route --- server/paths/apply.ts | 3 ++- server/routes/index.ts | 9 +++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/server/paths/apply.ts b/server/paths/apply.ts index 10cdcad3..36d8ea91 100644 --- a/server/paths/apply.ts +++ b/server/paths/apply.ts @@ -19,7 +19,8 @@ const paths = { applicationOrigin: applicationsPath.path('application-type'), selectApplicationOrigin: applicationsPath.path('select-application-origin'), people: { - find: peoplePath.path('find'), + findByPrisonNumber: peoplePath.path('find-by-prison-number'), + findByCrn: peoplePath.path('find-by-crn'), }, show: singleApplicationPath, overview: singleApplicationPath.path('overview'), diff --git a/server/routes/index.ts b/server/routes/index.ts index 99f5360c..1ad17814 100644 --- a/server/routes/index.ts +++ b/server/routes/index.ts @@ -21,11 +21,16 @@ export default function routes(controllers: Controllers, services: Services): Ro const { peopleController } = controllers - post(paths.applications.people.find.pattern, peopleController.findByPrisonNumber(), { - auditEvent: 'FIND_APPLICATION_PERSON', + post(paths.applications.people.findByPrisonNumber.pattern, peopleController.findByPrisonNumber(), { + auditEvent: 'FIND_APPLICATION_PERSON_BY_PRISON_NUMBER', auditBodyParams: ['prisonNumber'], }) + post(paths.applications.people.findByCrn.pattern, peopleController.findByCrn(), { + auditEvent: 'FIND_APPLICATION_PERSON_BY_CRN', + auditBodyParams: ['crn'], + }) + applyRoutes(controllers, router, services) assessRoutes(controllers, router, services) reportRoutes(controllers, router, services)