Skip to content

Commit

Permalink
refactor: DTO에서 achievement null 처리
Browse files Browse the repository at this point in the history
  • Loading branch information
kckc0608 committed Oct 6, 2024
1 parent 5bab5a6 commit 522a972
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import com.gdschongik.gdsc.infra.github.client.GithubClient;
import java.io.IOException;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
Expand Down Expand Up @@ -129,9 +128,6 @@ public List<StudentMyCompleteStudyResponse> getMyCompletedStudies() {
return studyHistories.stream()
.map(history -> {
List<AchievementType> achievementTypes = achievementsByStudy.get(history.getStudy());
if (achievementTypes == null) {
achievementTypes = new ArrayList<>();
}
return StudentMyCompleteStudyResponse.of(history, achievementTypes);
})
.toList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.gdschongik.gdsc.domain.study.domain.StudyHistory;
import com.gdschongik.gdsc.domain.study.domain.StudyHistoryStatus;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.ArrayList;
import java.util.List;

public record StudentMyCompleteStudyResponse(
Expand Down Expand Up @@ -32,6 +33,6 @@ public static StudentMyCompleteStudyResponse of(StudyHistory studyHistory, List<
studyHistory.getStudy().getMentor().getName(),
studyHistory.getStudy().getTotalWeek(),
studyHistory.getStudyHistoryStatus(),
achievements);
(achievements == null) ? new ArrayList<>() : achievements);
}
}

0 comments on commit 522a972

Please sign in to comment.