Revert "Deduplicate post view notifications"

This reverts commit 2fc22e7580.
This commit is contained in:
Tim
2025-08-01 11:49:40 +08:00
parent ba1432d945
commit e8e77b6467
3 changed files with 0 additions and 30 deletions

View File

@@ -18,6 +18,4 @@ public interface NotificationRepository extends JpaRepository<Notification, Long
List<Notification> findByComment(Comment comment);
void deleteByTypeAndFromUser(NotificationType type, User fromUser);
void deleteByUserAndTypeAndPostAndFromUser(User user, NotificationType type, Post post, User fromUser);
}

View File

@@ -58,9 +58,6 @@ public class NotificationService {
public Notification createNotification(User user, NotificationType type, Post post, Comment comment, Boolean approved,
User fromUser, ReactionType reactionType, String content) {
if (type == NotificationType.POST_VIEWED && post != null) {
notificationRepository.deleteByUserAndTypeAndPostAndFromUser(user, type, post, fromUser);
}
Notification n = new Notification();
n.setUser(user);
n.setType(type);