Skip to content

Commit

Permalink
CDPS-1085: Update name sort order (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielburnley authored Jan 29, 2025
1 parent 72826a3 commit 76c1333
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class PrisonerHealthService(
// This would be nice to move into request validation rather than having to validate here
val sort = request.sort.split(",")
if (sort[0] == "prisonerName") {
prisonerSearchClient.getPrisonersForPrison(prisonId, "firstName,lastName," + sort[1])
prisonerSearchClient.getPrisonersForPrison(prisonId, "lastName,firstName," + sort[1])
} else if (sort[0] == "location") {
prisonerSearchClient.getPrisonersForPrison(prisonId, "cellLocation," + sort[1])
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ class PrisonerHealthServiceTest {
HealthAndMedicationForPrisonRequest(1, 10, sort = "prisonerName,$direction"),
)

verify(prisonerSearchClient).getPrisonersForPrison(PRISON_ID, "firstName,lastName,$direction")
verify(prisonerSearchClient).getPrisonersForPrison(PRISON_ID, "lastName,firstName,$direction")
}

@ParameterizedTest
Expand Down

0 comments on commit 76c1333

Please sign in to comment.