From 4aa776ae866a27d883eaec94be6eadbecf98075d Mon Sep 17 00:00:00 2001 From: NARUBROWN Date: Fri, 29 Nov 2024 09:18:20 +0900 Subject: [PATCH] =?UTF-8?q?[Fix]=20=EC=B1=95=ED=84=B0=20=EB=8B=A8=20?= =?UTF-8?q?=EA=B1=B4=20=EC=A1=B0=ED=9A=8C=20=ED=95=B4=EA=B2=B0=20=EC=83=81?= =?UTF-8?q?=ED=83=9C=20=EC=A1=B0=EA=B1=B4=20=EB=B6=88=EC=9D=BC=EC=B9=98=20?= =?UTF-8?q?=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../codingland/domain/chapter/dto/ResponseChapterDto.java | 4 ++-- .../codingland/domain/chapter/service/ChapterService.java | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/domain/src/main/java/com/codingland/domain/chapter/dto/ResponseChapterDto.java b/domain/src/main/java/com/codingland/domain/chapter/dto/ResponseChapterDto.java index 42469ff..66f1aca 100644 --- a/domain/src/main/java/com/codingland/domain/chapter/dto/ResponseChapterDto.java +++ b/domain/src/main/java/com/codingland/domain/chapter/dto/ResponseChapterDto.java @@ -10,7 +10,7 @@ public record ResponseChapterDto( Long id, String name, boolean isCleared, - List quizzes, - boolean isRewardButtonActive + boolean isRewardButtonActive, + List quizzes ) { } diff --git a/domain/src/main/java/com/codingland/domain/chapter/service/ChapterService.java b/domain/src/main/java/com/codingland/domain/chapter/service/ChapterService.java index 0f75a57..2060f9e 100644 --- a/domain/src/main/java/com/codingland/domain/chapter/service/ChapterService.java +++ b/domain/src/main/java/com/codingland/domain/chapter/service/ChapterService.java @@ -93,10 +93,14 @@ public ResponseChapterDto getChapter(Long chapter_id, Long user_id) { buttonActiveState = false; } + if(foundChapter.getQuizzes().isEmpty()) { + buttonActiveState = false; + } + Map quizClearedMap = new HashMap<>(); for (IsQuizCleared clearedQuiz : clearedQuizzes) { - quizClearedMap.put(clearedQuiz.getId(), clearedQuiz); + quizClearedMap.put(clearedQuiz.getQuiz().getId(), clearedQuiz); } List responseQuizDtoList = new ArrayList<>();