Skip to content

Commit

Permalink
[REFACTOR] 전체 조회에 대한 Filter 요청에 대해 Early Return 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
yummygyudon committed Dec 28, 2024
1 parent 43a04ec commit 8328cd7
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ public List<BannerSimple> getBanners(FilterCriteria filter, SortCriteria sort) {
}

private List<Banner> getFilteredBanners(List<Banner> banners, FilterCriteria filter) {
val targetStatus = PublishStatus.getByValue(filter.getParameter());
if (targetStatus == null) {
if (FilterCriteria.ALL.equals(filter)) {
return banners;
}
val targetStatus = PublishStatus.getByValue(filter.getParameter());
return banners.stream()
.filter(banner -> targetStatus.equals(banner.getPeriod().getPublishStatus(LocalDate.now())))
.toList();
Expand Down

0 comments on commit 8328cd7

Please sign in to comment.