Skip to content

Commit

Permalink
feat - #183 challengeDate로 정렬하는 조건 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
jumining committed Jul 21, 2024
1 parent a016925 commit d3fa095
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package sopt.org.hmh.domain.dailychallenge.service;

import java.util.Comparator;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
Expand Down Expand Up @@ -37,6 +38,7 @@ public List<Status> addFinishedDailyChallengeHistory(Long userId, FinishedDailyC

return challenge.getHistoryDailyChallenges()
.stream()
.sorted(Comparator.comparing(DailyChallenge::getChallengeDate))
.map(DailyChallenge::getStatus)
.toList();
}
Expand All @@ -61,6 +63,7 @@ public List<Status> changeDailyChallengeStatusByIsSuccess(Long userId, FinishedD

return challenge.getHistoryDailyChallenges()
.stream()
.sorted(Comparator.comparing(DailyChallenge::getChallengeDate))
.map(DailyChallenge::getStatus)
.toList();
}
Expand Down

0 comments on commit d3fa095

Please sign in to comment.