Skip to content

Commit

Permalink
fix: 쿼리 정렬조건 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
kdomo committed May 9, 2024
1 parent 2d8b72e commit 1798660
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ public void sendMissionRemindPush(PushMissionRemindRequest request) {

public List<NotificationFindAllResponse> findAllNotification() {
final Member member = memberUtil.getCurrentMember();
return notificationRepository.findAllByTargetMemberId(member.getId()).stream()
return notificationRepository
.findAllByTargetMemberIdOrderByCreatedAtDesc(member.getId())
.stream()
.map(
notification ->
NotificationFindAllResponse.of(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ public interface NotificationRepository extends JpaRepository<Notification, Long
Optional<Notification> findBySourceMemberIdAndTargetMemberIdAndNotificationType(
Long sourceId, Long targetId, NotificationType notificationType);

List<Notification> findAllByTargetMemberId(Long memberId);
List<Notification> findAllByTargetMemberIdOrderByCreatedAtDesc(Long targetMemberId);
}

0 comments on commit 1798660

Please sign in to comment.