diff --git a/src/main/java/org/hankki/hankkiserver/api/store/service/StoreFinder.java b/src/main/java/org/hankki/hankkiserver/api/store/service/StoreFinder.java index 42462686..1aec557e 100644 --- a/src/main/java/org/hankki/hankkiserver/api/store/service/StoreFinder.java +++ b/src/main/java/org/hankki/hankkiserver/api/store/service/StoreFinder.java @@ -18,8 +18,8 @@ protected Store findByIdWhereDeletedIsFalse(Long id) { .orElseThrow(() -> new NotFoundException(StoreErrorCode.STORE_NOT_FOUND)); } - protected Store findStoreByIdWithHeart(Long id) { - return storeRepository.findStoreByIdWithHeart(id) + protected Store findByIdWithHeartAndIsDeletedFalse(Long id) { + return storeRepository.findByIdWithHeartAndIsDeletedFalse(id) .orElseThrow(() -> new NotFoundException(StoreErrorCode.STORE_NOT_FOUND)); } } diff --git a/src/main/java/org/hankki/hankkiserver/api/store/service/StoreQueryService.java b/src/main/java/org/hankki/hankkiserver/api/store/service/StoreQueryService.java index 3a3cdc9f..643a17db 100644 --- a/src/main/java/org/hankki/hankkiserver/api/store/service/StoreQueryService.java +++ b/src/main/java/org/hankki/hankkiserver/api/store/service/StoreQueryService.java @@ -29,7 +29,7 @@ public StoreThumbnailResponse getStoreThumbnail(Long id) { @Transactional(readOnly = true) public StoreGetResponse getStoreInformation(Long id) { - Store store = storeFinder.findStoreByIdWithHeart(id); + Store store = storeFinder.findByIdWithHeartAndIsDeletedFalse(id); return StoreGetResponse.of(store, isLiked(id, store), diff --git a/src/main/java/org/hankki/hankkiserver/domain/store/repository/StoreRepository.java b/src/main/java/org/hankki/hankkiserver/domain/store/repository/StoreRepository.java index 423632f5..4fa67e8f 100644 --- a/src/main/java/org/hankki/hankkiserver/domain/store/repository/StoreRepository.java +++ b/src/main/java/org/hankki/hankkiserver/domain/store/repository/StoreRepository.java @@ -11,5 +11,5 @@ public interface StoreRepository extends JpaRepository { Optional findByIdAndIsDeletedIsFalse(Long id); @Query("select s from Store s join fetch s.hearts where s.id = :id and s.isDeleted = false") - Optional findStoreByIdWithHeart(Long id); + Optional findByIdWithHeartAndIsDeletedFalse(Long id); }