Skip to content

Commit 99fb881

Browse files
Code review updates.
1 parent 9ad4c26 commit 99fb881

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/kotlin/uk/gov/justice/digital/hmpps/personalrelationships/service/ContactSearchService.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ class ContactSearchService(
4343
fun searchContacts(request: ContactSearchRequest, pageable: Pageable): Page<ContactSearchResultItem> {
4444
validateRequest(request)
4545

46-
// force adding contactId sort to the pageable as without it same ID is encountered across multiple pages.
47-
// only append the contactId sort if it (or its alias "id") is not already present
48-
val sortWithId = if (pageable.sort.getOrderFor("contactId") == null && pageable.sort.getOrderFor("id") == null) {
46+
// force adding contactId sort to the pageable as without it the same contactId is encountered across multiple pages.
47+
// only append the contactId sort if it is not already present
48+
val sortWithId = if (pageable.sort.getOrderFor("contactId") == null) {
4949
pageable.sort.and(Sort.by("contactId").ascending())
5050
} else {
5151
pageable.sort

0 commit comments

Comments
 (0)