RED-8248: Sent comments are not sorted by order of arrival
* added sorting for getComments called from controller
This commit is contained in:
parent
06ea42c410
commit
42b410f6f7
@ -108,7 +108,7 @@ public class CommentService {
|
||||
|
||||
public List<Comment> getComments(String fileId, String annotationId) {
|
||||
|
||||
return toCommentList(commentPersistenceService.findCommentsByAnnotationId(fileId, annotationId, false));
|
||||
return toCommentList(commentPersistenceService.findCommentsByAnnotationIdSortByDate(fileId, annotationId, false));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -78,6 +78,15 @@ public class CommentPersistenceService {
|
||||
}
|
||||
|
||||
|
||||
public List<CommentEntity> findCommentsByAnnotationIdSortByDate(String fileId, String annotationId, boolean includeDeletions) {
|
||||
|
||||
return commentRepository.findByFileIdAndAnnotationId(fileId, annotationId, includeDeletions)
|
||||
.stream()
|
||||
.sorted(Comparator.comparing(CommentEntity::getDate))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
@Transactional
|
||||
public void softDelete(long commentId, OffsetDateTime softDeletedTime) {
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user