fix(search): sort document overview by createdAt DESC instead of documentDate ASC
Some checks failed
CI / Unit & Component Tests (push) Has been cancelled
CI / Backend Unit Tests (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
CI / Unit & Component Tests (pull_request) Has been cancelled
CI / Backend Unit Tests (pull_request) Has been cancelled
CI / E2E Tests (pull_request) Has been cancelled

Newly uploaded documents (from bulk drop-zone or Excel import) have no
documentDate, so they were sinking to the bottom. Sorting by createdAt
DESC puts the most recently added documents first.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-03-26 10:32:46 +01:00
parent db103ca1ab
commit 6a663cefe6

View File

@@ -234,8 +234,8 @@ public class DocumentService {
.and(hasReceiver(receiver))
.and(hasTags(tags));
// Immer sortiert nach Datum
return documentRepository.findAll(spec, Sort.by(Sort.Direction.ASC, "documentDate"));
// Neueste zuerst (nach Erstellungsdatum)
return documentRepository.findAll(spec, Sort.by(Sort.Direction.DESC, "createdAt"));
}
// 2. SPEZIALITÄT: Der Schriftwechsel