fix usercomments

This commit is contained in:
_Bastler 2021-10-06 13:16:30 +02:00
parent 7e0c292d7c
commit 06e402a8f2
1 changed files with 21 additions and 23 deletions

View File

@ -105,10 +105,8 @@ public class CommentManager {
public Page<Comment> fetchByUsername(String username, Long orElse, Instant date, int page,
int size, boolean asc) {
Sort sort = Sort.by(asc ? Order.asc("created") : Order.desc("created"));
return commentRepository
.findAll(
qComment.author.equalsIgnoreCase(username).and(qComment.parent.isNull())
.and(qComment.created.before(date)),
return commentRepository.findAll(
qComment.author.equalsIgnoreCase(username).and(qComment.created.before(date)),
PageRequest.of(page, size, sort));
}