From 8328cd77e406bc9a37d4ab4998cf3435121f40a0 Mon Sep 17 00:00:00 2001 From: yummygyudon Date: Sat, 28 Dec 2024 20:58:08 +0900 Subject: [PATCH] =?UTF-8?q?[REFACTOR]=20=EC=A0=84=EC=B2=B4=20=EC=A1=B0?= =?UTF-8?q?=ED=9A=8C=EC=97=90=20=EB=8C=80=ED=95=9C=20Filter=20=EC=9A=94?= =?UTF-8?q?=EC=B2=AD=EC=97=90=20=EB=8C=80=ED=95=B4=20Early=20Return=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../operation/web/banner/service/BannerServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/operation-api/src/main/java/org/sopt/makers/operation/web/banner/service/BannerServiceImpl.java b/operation-api/src/main/java/org/sopt/makers/operation/web/banner/service/BannerServiceImpl.java index 8ac07909..0c516898 100644 --- a/operation-api/src/main/java/org/sopt/makers/operation/web/banner/service/BannerServiceImpl.java +++ b/operation-api/src/main/java/org/sopt/makers/operation/web/banner/service/BannerServiceImpl.java @@ -110,10 +110,10 @@ public List getBanners(FilterCriteria filter, SortCriteria sort) { } private List getFilteredBanners(List 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();