Skip to content

Commit

Permalink
[Fix] 챕터 단 건 조회에서 보상 수령 버튼이 True로 바뀌지 않던 문제를 해결했습니다.
Browse files Browse the repository at this point in the history
  • Loading branch information
NARUBROWN committed Nov 29, 2024
1 parent d6c4039 commit 887b9a1
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,16 @@ public ResponseChapterDto getChapter(Long chapter_id, Long user_id) {
IsChapterCleared foundIsChapterCleared = isChapterClearedRepository.findByChapterAndUser(foundChapter, foundUser)
.orElse(null);

List<IsQuizCleared> clearedQuizzes = isQuizClearedRepository.findAllByUserAndQuizIn(foundUser, foundChapter.getQuizzes());
Set<Long> clearedQuizzesIds = new HashSet<>();

List<Long> quizIds = new ArrayList<>();
for (Quiz quiz : foundChapter.getQuizzes()) {
quizIds.add(quiz.getId());
}

List<IsQuizCleared> clearedQuizzes = isQuizClearedRepository.findAllByUserAndQuizIn(foundUser, foundChapter.getQuizzes());
Set<Long> clearedQuizzesIds = new HashSet<>();

for (IsQuizCleared clearedQuiz : clearedQuizzes) {
clearedQuizzesIds.add(clearedQuiz.getId());
clearedQuizzesIds.add(clearedQuiz.getQuiz().getId());
}

boolean buttonActiveState = true;
Expand Down

0 comments on commit 887b9a1

Please sign in to comment.