Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: 알림 구현 리팩토링 #155

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,13 @@ public List<CalendarEventResponse> convertToDto(CalendarEvent calendarEvent) {
.orElseThrow(MemberNotFoundException::new);


Notification notification = notificationRepository.findByEventAndMember(calendarEvent, member).orElseThrow(NotificationNotFoundException::new);;
boolean notificationActive = notification != null && notification.isActive();
Notification notification = notificationRepository.findByEventAndMember(calendarEvent, member);
boolean notificationActive;
if(notification != null) {
notificationActive = notification.isActive();
} else {
notificationActive = false;
}
Long notificationId = notification != null ? notification.getNotificationId() : null;

if (endDate == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public interface NotificationRepository extends JpaRepository<Notification, Long

List<Notification> findByNotificationDate(LocalDate notification);

Optional<Notification> findByEventAndMember(CalendarEvent calendarEvent, Member member);
Notification findByEventAndMember(CalendarEvent calendarEvent, Member member);

List<Notification> findByMember(Member member);
}
Loading