Skip to content

Commit

Permalink
feat: 두피 타입에 맞는 샴푸 찾기 리포지토리 로직 수정
Browse files Browse the repository at this point in the history
기존, 모두 false -> ProductNotFoundException
현재, 모두 false -> DB에 존재하는 모든 샴푸들 보여주기로 변경
  • Loading branch information
kjungw1025 committed Dec 3, 2023
1 parent b624978 commit c0d7ef9
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ public List<ScalpCareProduct> findAllByShampooType(RequestProductDto dto) {
jpql += ")";

if (isFirstCondition) {
throw new ProductNotFoundException();
// 모두 false이면, 모든 샴푸 보여주기로 변경
jpql = "select s from ScalpCareProduct s " +
"where s.id in (select p.scalpCareProduct.id from ProductProperty p " +
"where p.careDevice = 0)";
}

TypedQuery<ScalpCareProduct> query = em.createQuery(jpql, ScalpCareProduct.class);
Expand Down

0 comments on commit c0d7ef9

Please sign in to comment.