diff --git a/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/api/controller/CaseloadController.kt b/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/api/controller/CaseloadController.kt index 4e69e1db2f..af7642952b 100644 --- a/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/api/controller/CaseloadController.kt +++ b/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/api/controller/CaseloadController.kt @@ -31,7 +31,7 @@ class CaseloadController(private val userService: UserService) { @PathVariable username: String, @RequestParam(required = false, defaultValue = "0") page: Int, @RequestParam(required = false, defaultValue = "100") size: Int, - @RequestParam(required = false, defaultValue = "nextContact.desc") sortBy: String, + @RequestParam(required = false, defaultValue = "nextContact.asc") sortBy: String, @RequestBody body: UserSearchFilter ) = userService.searchUserCaseload(username, body, PageRequest.of(page, size, sort(sortBy)), sortBy) diff --git a/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/user/entity/User.kt b/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/user/entity/User.kt index a8a2838320..725d04fbd8 100644 --- a/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/user/entity/User.kt +++ b/projects/manage-supervision-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/integrations/delius/user/entity/User.kt @@ -454,8 +454,8 @@ interface CaseloadRepository : JpaRepository { } enum class CaseloadOrderType(val sortColumn: String) { - NEXT_CONTACT("naType.description"), - LAST_CONTACT("paType.description"), + NEXT_CONTACT("na.appointmentDatetime"), + LAST_CONTACT("pa.appointmentDatetime"), SENTENCE("dt.description"), SURNAME("p.surname"), NAME_OR_CRN("p.surname"),