We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7d3ce17 commit 6ac53c3Copy full SHA for 6ac53c3
adapters/out-persistence/src/main/kotlin/com/pokit/out/persistence/category/impl/CategoryAdapter.kt
@@ -50,8 +50,13 @@ class CategoryAdapter(
50
}
51
52
override fun loadAllInId(categoryIds: List<Long>, pageable: Pageable): Slice<Category> {
53
- return categoryRepository.findAllByIdInAndDeleted(categoryIds, pageable, false)
54
- .map { it.toDomain() }
+ return if (pageable.sort.equals("createdAt")) {
+ categoryRepository.findAllByIdInAndCreatedAtSort(categoryIds, pageable, false)
55
+ .map { it.toDomain() }
56
+ } else {
57
+ categoryRepository.findAllByIdInAndNameSort(categoryIds, pageable, false)
58
59
+ }
60
61
62
0 commit comments