Skip to content

Commit

Permalink
fix(Notification): if one writes a comment on the post, the post writ…
Browse files Browse the repository at this point in the history
…er receives notification whose type is Post and whose causedById is the post's id
  • Loading branch information
becooq81 committed Jul 16, 2024
1 parent bb04021 commit 2e62690
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ public enum NotificationType {
MESSAGE,
BADGE,
COMMENT,
RECOMMENT;
POST;
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@ public void createMessageNotification(String senderId, String receiverId, Long m
public void createCommentNotification(String senderId, String receiverId, Long postId) {
Member sender = getMemberByLoginID(senderId);
Member receiver = getMemberByLoginID(receiverId);
notificationRepository.save(new Notification(senderId, receiverId, postId, NotificationType.COMMENT));
notificationRepository.save(new Notification(senderId, receiverId, postId, NotificationType.POST));
receiver.addNotification();
}

@Transactional
public void createRecommentNotification(String senderId, String receiverId, Long postId, Long parentCommentId) {
Member sender = getMemberByLoginID(senderId);
Member receiver = getMemberByLoginID(receiverId);
notificationRepository.save(new Notification(senderId, receiverId, parentCommentId, NotificationType.RECOMMENT));
notificationRepository.save(new Notification(senderId, receiverId, parentCommentId, NotificationType.COMMENT));
receiver.addNotification();
}

Expand Down

0 comments on commit 2e62690

Please sign in to comment.