fix usercomments
This commit is contained in:
parent
7e0c292d7c
commit
06e402a8f2
@ -105,10 +105,8 @@ public class CommentManager {
|
|||||||
public Page<Comment> fetchByUsername(String username, Long orElse, Instant date, int page,
|
public Page<Comment> fetchByUsername(String username, Long orElse, Instant date, int page,
|
||||||
int size, boolean asc) {
|
int size, boolean asc) {
|
||||||
Sort sort = Sort.by(asc ? Order.asc("created") : Order.desc("created"));
|
Sort sort = Sort.by(asc ? Order.asc("created") : Order.desc("created"));
|
||||||
return commentRepository
|
return commentRepository.findAll(
|
||||||
.findAll(
|
qComment.author.equalsIgnoreCase(username).and(qComment.created.before(date)),
|
||||||
qComment.author.equalsIgnoreCase(username).and(qComment.parent.isNull())
|
|
||||||
.and(qComment.created.before(date)),
|
|
||||||
PageRequest.of(page, size, sort));
|
PageRequest.of(page, size, sort));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user