Skip to content

Commit

Permalink
[ADD] 달성횟수 1회 이상 필터링 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
thguss committed Jan 13, 2025
1 parent 28b3cb4 commit 802daaf
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,15 @@ public AchievedThemeResponse getAchievementTheme(long memberId, long themeId) {

val routines = routineAdapter.findByThemeId(themeId);
val routineIds = routines.stream().map(Routine::getId).toList();
val memberRoutines = memberRoutineAdapter.findAllByRoutineIds(memberId, routineIds);
val memberRoutines = memberRoutineAdapter.findAllByRoutineIds(memberId, routineIds)
.stream().filter(it -> it.getAchievementCount() > 0)
.toList();

val challenges = challengeAdapter.findAllByTheme(themeId);
val challengeIds = challenges.stream().map(Challenge::getId).toList();
val memberChallenges = memberChallengeAdapter.findAllByChallengeIds(memberId, challengeIds);
val memberChallenges = memberChallengeAdapter.findAllByChallengeIds(memberId, challengeIds)
.stream().filter(it -> it.getAchievedCount() > 0)
.toList();

return AchievedThemeResponse.of(
theme,
Expand Down

0 comments on commit 802daaf

Please sign in to comment.