From bc01334bf214923fe309f7ae7f97dc8d53f0a3e2 Mon Sep 17 00:00:00 2001 From: Ssuamje Date: Wed, 29 Nov 2023 13:08:41 +0900 Subject: [PATCH] =?UTF-8?q?[BE]=20FIX=20:=20delete=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user/repository/LentExtensionOptionalFetcher.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/org/ftclub/cabinet/user/repository/LentExtensionOptionalFetcher.java b/backend/src/main/java/org/ftclub/cabinet/user/repository/LentExtensionOptionalFetcher.java index 8ab67f2b7..e21d33938 100644 --- a/backend/src/main/java/org/ftclub/cabinet/user/repository/LentExtensionOptionalFetcher.java +++ b/backend/src/main/java/org/ftclub/cabinet/user/repository/LentExtensionOptionalFetcher.java @@ -28,13 +28,15 @@ public Page findAllLentExtension(PageRequest pageable) { @Transactional(readOnly = true) public Page findAllNotExpired(PageRequest pageable) { - return lentExtensionRepository.findAllNotExpired(pageable); + return lentExtensionRepository.findAllNotExpired(pageable) + .stream().filter(e -> !e.isUsed() && !e.isDeleted()) + .collect(Collectors.collectingAndThen(Collectors.toList(), PageImpl::new)); } @Transactional(readOnly = true) public List findAllNotExpired() { return lentExtensionRepository.findAll() - .stream().filter(e -> !e.isUsed()) + .stream().filter(e -> !e.isUsed() && !e.isDeleted()) .collect(Collectors.toList()); }