refactor(search): remove dead SENDER case from resolveSort switch
SENDER and RECEIVER are handled by in-memory sort before resolveSort is called, making those switch cases unreachable. Removed and added a comment making the invariant explicit. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -308,9 +308,9 @@ public class DocumentService {
|
||||
if (sort == null || sort == DocumentSort.DATE) {
|
||||
return Sort.by(direction, "documentDate");
|
||||
}
|
||||
// SENDER and RECEIVER are sorted in-memory before this method is called
|
||||
return switch (sort) {
|
||||
case TITLE -> Sort.by(direction, "title");
|
||||
case SENDER -> Sort.by(direction, "sender.lastName").and(Sort.by(direction, "sender.firstName"));
|
||||
case UPLOAD_DATE -> Sort.by(direction, "createdAt");
|
||||
default -> Sort.by(direction, "documentDate");
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user