diff --git a/src/main/java/site/billbill/apiserver/repository/borrowPosts/ItemDslRepositoryImpl.java b/src/main/java/site/billbill/apiserver/repository/borrowPosts/ItemDslRepositoryImpl.java index b454bec..6c61cbd 100644 --- a/src/main/java/site/billbill/apiserver/repository/borrowPosts/ItemDslRepositoryImpl.java +++ b/src/main/java/site/billbill/apiserver/repository/borrowPosts/ItemDslRepositoryImpl.java @@ -37,12 +37,12 @@ public Page findItemsWithConditions(String category, Pageable pa JPAQuery query = queryFactory.selectFrom(items) - .leftJoin(items.category, categoryEntity).fetchJoin() // 명시적 Fetch Join - .leftJoin(borrow).on(items.id.eq(borrow.item.id)) - .where(items.delYn.isFalse()); + .leftJoin(items.category, categoryEntity).fetchJoin() // 명시적 Fetch Join + .leftJoin(borrow).on(items.id.eq(borrow.item.id)) + .where(items.delYn.isFalse()); // 카테고리 필터링 - if(category==null){ + if (category == null) { query.where(items.category.isNull()); } else if (!"entire".equals(category)) { var fetchedCategory = queryFactory.selectFrom(categoryEntity)