diff --git a/src/main/java/org/ntlab/citrusserver/repositories/PublicBookManager.java b/src/main/java/org/ntlab/citrusserver/repositories/PublicBookManager.java index 1e5761d..7d7b6d0 100644 --- a/src/main/java/org/ntlab/citrusserver/repositories/PublicBookManager.java +++ b/src/main/java/org/ntlab/citrusserver/repositories/PublicBookManager.java @@ -45,7 +45,7 @@ public ArrayList searchBooksByTitle(String title, int sortBy){ if(sortBy == 0){ ArrayList result = searchBooksByTitle(title); - result.sort(Comparator.comparing(Book::getTime)); + result.sort(Comparator.comparing(Book::getTime).reversed()); return result; } return null; @@ -64,6 +64,11 @@ } public ArrayList searchBooksByAccount(String accountId, int sortBy){ + if(sortBy == 0){ + ArrayList result = searchBooksByAccount(accountId); + result.sort(Comparator.comparing(Book::getTime).reversed()); + return result; + } return null; }