Skip to content

Commit c4f773d

Browse files
authored
Merge pull request #535 from TaskFlow-CLAP/CLAP-411
CLAP-411 미확인 알림 개수 조회 오류 해결
2 parents f65f68c + a453638 commit c4f773d

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

src/main/java/clap/server/adapter/outbound/api/email/EmailTemplateBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public EmailTemplate createNewPasswordTemplate(String receiver, String receiverN
100100
Context context = new Context();
101101
String templateName = "new-password";
102102
String subject = "[TaskFlow] 비밀번호 재설정";
103-
context.setVariable("loginLink", "http://localhost:5173/login");
103+
context.setVariable("loginLink", REDIRECT_URL_LOGIN);
104104
context.setVariable("newPassword", newPassword);
105105
context.setVariable("receiverName", receiverName);
106106
String body = templateEngine.process(templateName, context);

src/main/java/clap/server/adapter/outbound/persistense/NotificationPersistenceAdapter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public List<Notification> findNotificationsByTaskId(Long taskId) {
5151

5252
@Override
5353
public Integer countNotification(final Long memberId) {
54-
return notificationRepository.countByIsReadFalseAndReceiver_MemberId(memberId);
54+
return notificationRepository.countUnreadByMemberId(memberId);
5555
}
5656

5757
@Override

src/main/java/clap/server/adapter/outbound/persistense/repository/notification/NotificationRepository.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,18 @@ public interface NotificationRepository extends JpaRepository<NotificationEntity
1717

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

2524
@Query("SELECT n FROM NotificationEntity n " +
26-
"WHERE n.receiver.memberId = :receiverId " +
27-
"AND n.task.isDeleted = false")
25+
"WHERE n.receiver.memberId = :receiverId")
2826
List<NotificationEntity> findAllByReceiver_MemberId(Long receiverId);
2927

3028
List<NotificationEntity> findByTask_TaskId(Long taskId);
3129

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

0 commit comments

Comments
 (0)