Skip to content

Commit

Permalink
Merge pull request #247 from JNU-econovation/feature/BE-91
Browse files Browse the repository at this point in the history
[REFACTOR] Optional 구문 수정 및 기본 board 는 true 반환
  • Loading branch information
rlajm1203 authored Sep 9, 2024
2 parents c27cfda + 55fe7ce commit 425c756
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,16 @@ public List<BoardCardResponseDto> getByNavigationId(Integer navigationId, Intege

boards = boards.stream()
.filter(
board ->
Optional.ofNullable(board.getCardId())
.map(id -> answerIdByCardIdMap.getOrDefault(id, null))
.map(id -> yearByAnswerIdMap.getOrDefault(id, null))
.map(y -> y.equals(year))
.orElse(false))
board ->{
if(board.getId()==1 || board.getId()==2 || board.getId()==3) {
return true;
}
return Optional.ofNullable(board.getCardId())
.map(answerIdByCardIdMap::get)
.map(yearByAnswerIdMap::get)
.map(y -> y.equals(year))
.orElse(false);
})
.toList();

cards =
Expand Down

0 comments on commit 425c756

Please sign in to comment.