diff --git a/src/main/java/com/goat/server/directory/repository/DirectoryRepositoryImpl.java b/src/main/java/com/goat/server/directory/repository/DirectoryRepositoryImpl.java index 8a0866e..f01c09e 100644 --- a/src/main/java/com/goat/server/directory/repository/DirectoryRepositoryImpl.java +++ b/src/main/java/com/goat/server/directory/repository/DirectoryRepositoryImpl.java @@ -37,7 +37,7 @@ public List findAllDirectoryResponseBySortAndSearch( //search가 null이면 parentDirectoryId로 검색, 아니면 search로 검색 - search 존재 -> 전체 검색 private BooleanExpression isSearchExpression(Long parentDirectoryId, String search) { - if (StringUtils.hasLength(search)) { + if (!StringUtils.hasLength(search)) { return parentDirectoryFindExpression(parentDirectoryId); } else { return directory.title.contains(search); diff --git a/src/main/java/com/goat/server/review/repository/ReviewRepositoryImpl.java b/src/main/java/com/goat/server/review/repository/ReviewRepositoryImpl.java index afed6d5..1718140 100644 --- a/src/main/java/com/goat/server/review/repository/ReviewRepositoryImpl.java +++ b/src/main/java/com/goat/server/review/repository/ReviewRepositoryImpl.java @@ -37,7 +37,7 @@ public List findAllReviewSimpleResponseBySortAndSearch( //search가 null이면 parentDirectoryId로 검색, 아니면 search로 검색 - search 존재 -> 전체 검색 private BooleanExpression searchExpression(Long parentDirectoryId, String search) { - if (StringUtils.hasLength(search)) { + if (!StringUtils.hasLength(search)) { return review.directory.id.eq(parentDirectoryId); } else { return review.title.contains(search);