Skip to content

Commit

Permalink
Merge pull request #535 from TaskFlow-CLAP/CLAP-411
Browse files Browse the repository at this point in the history
CLAP-411 미확인 알림 개수 조회 오류 해결
  • Loading branch information
joowojr authored Feb 13, 2025
2 parents f65f68c + a453638 commit c4f773d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public EmailTemplate createNewPasswordTemplate(String receiver, String receiverN
Context context = new Context();
String templateName = "new-password";
String subject = "[TaskFlow] 비밀번호 재설정";
context.setVariable("loginLink", "http://localhost:5173/login");
context.setVariable("loginLink", REDIRECT_URL_LOGIN);
context.setVariable("newPassword", newPassword);
context.setVariable("receiverName", receiverName);
String body = templateEngine.process(templateName, context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public List<Notification> findNotificationsByTaskId(Long taskId) {

@Override
public Integer countNotification(final Long memberId) {
return notificationRepository.countByIsReadFalseAndReceiver_MemberId(memberId);
return notificationRepository.countUnreadByMemberId(memberId);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,18 @@ public interface NotificationRepository extends JpaRepository<NotificationEntity

@Query("SELECT n FROM NotificationEntity n " +
"WHERE n.receiver.memberId = :receiverId " +
"AND n.task.isDeleted = false " +
"ORDER BY n.createdAt DESC")
Slice<NotificationEntity> findAllByReceiver_MemberIdOrderByCreatedAtDesc(
@Param("receiverId") Long receiverId, Pageable pageable);

@Query("SELECT n FROM NotificationEntity n " +
"WHERE n.receiver.memberId = :receiverId " +
"AND n.task.isDeleted = false")
"WHERE n.receiver.memberId = :receiverId")
List<NotificationEntity> findAllByReceiver_MemberId(Long receiverId);

List<NotificationEntity> findByTask_TaskId(Long taskId);

Integer countByIsReadFalseAndReceiver_MemberId(Long memberId);
@Query("SELECT COUNT(n) FROM NotificationEntity n " +
"WHERE n.isRead = false " +
"AND n.receiver.memberId = :memberId")
Integer countUnreadByMemberId(@Param("memberId") Long memberId);
}

0 comments on commit c4f773d

Please sign in to comment.