Skip to content

Commit

Permalink
[refac] change method names
Browse files Browse the repository at this point in the history
  • Loading branch information
Parkjyun committed Jul 12, 2024
1 parent 6e0cd52 commit b9c3846
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ public interface StoreRepository extends JpaRepository<Store, Long> {
Optional<Store> findByIdAndIsDeletedIsFalse(Long id);

@Query("select s from Store s join fetch s.hearts where s.id = :id and s.isDeleted = false")
Optional<Store> findStoreByIdWithHeart(Long id);
Optional<Store> findByIdWithHeartAndIsDeletedFalse(Long id);
}

0 comments on commit b9c3846

Please sign in to comment.