Fix post count for older threads with lazy deleted forum posts
This commit is contained in:
parent
2983e13af6
commit
23295d3875
@ -15,6 +15,7 @@ import jakarta.persistence.Table;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.function.Predicate;
|
||||
import se.su.dsv.scipro.system.LazyDeletableDomainObject;
|
||||
import se.su.dsv.scipro.system.User;
|
||||
|
||||
@ -100,8 +101,8 @@ public class ForumThread extends LazyDeletableDomainObject {
|
||||
posts.add(post);
|
||||
}
|
||||
|
||||
public int getPostCount() {
|
||||
return posts.size();
|
||||
public long getPostCount() {
|
||||
return posts.stream().filter(Predicate.not(ForumPost::isDeleted)).count();
|
||||
}
|
||||
|
||||
public User getCreatedBy() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user