diff --git a/server-yml b/server-yml index b792c34c..d1485007 160000 --- a/server-yml +++ b/server-yml @@ -1 +1 @@ -Subproject commit b792c34c7d8325341b53887497df0e45b5774fcb +Subproject commit d1485007111421cd0539cf8826ac213e090bcdc7 diff --git a/src/main/java/org/hankki/hankkiserver/api/user/service/response/UserHeartedStoreListResponse.java b/src/main/java/org/hankki/hankkiserver/api/user/service/response/UserHeartedStoreListResponse.java index 8d405eaf..198ecf3d 100644 --- a/src/main/java/org/hankki/hankkiserver/api/user/service/response/UserHeartedStoreListResponse.java +++ b/src/main/java/org/hankki/hankkiserver/api/user/service/response/UserHeartedStoreListResponse.java @@ -8,7 +8,8 @@ public record UserHeartedStoreListResponse( List stores ) { public static UserHeartedStoreListResponse of(List hearts) { - return new UserHeartedStoreListResponse(hearts.stream() + return new UserHeartedStoreListResponse( + hearts.stream() .map(heart -> UserHeartedStoreViewResponse.of(heart.getStore())) .toList()); } diff --git a/src/main/java/org/hankki/hankkiserver/api/user/service/response/UserHeartedStoreViewResponse.java b/src/main/java/org/hankki/hankkiserver/api/user/service/response/UserHeartedStoreViewResponse.java index cc8ee577..31e229ea 100644 --- a/src/main/java/org/hankki/hankkiserver/api/user/service/response/UserHeartedStoreViewResponse.java +++ b/src/main/java/org/hankki/hankkiserver/api/user/service/response/UserHeartedStoreViewResponse.java @@ -14,7 +14,7 @@ public static UserHeartedStoreViewResponse of(Store store) { return new UserHeartedStoreViewResponse( store.getId(), store.getName(), - store.getImages().get(0).getImageUrl(), + store.getImageUrlOrElseNull(), store.getCategory().getName(), store.getLowestPrice(), store.getHeartCount() diff --git a/src/main/java/org/hankki/hankkiserver/domain/heart/repository/HeartRepository.java b/src/main/java/org/hankki/hankkiserver/domain/heart/repository/HeartRepository.java index ae7d42d2..36db6ebc 100644 --- a/src/main/java/org/hankki/hankkiserver/domain/heart/repository/HeartRepository.java +++ b/src/main/java/org/hankki/hankkiserver/domain/heart/repository/HeartRepository.java @@ -13,7 +13,7 @@ public interface HeartRepository extends JpaRepository { boolean existsByUserAndStore(User user, Store store); void deleteByUserAndStore(User user, Store store); - @Query("select h from Heart h join fetch h.store s join fetch s.images " + - "where h.user.id = :userId and s.isDeleted = false order by h.id desc") + @Query("select h from Heart h join fetch h.store " + + "where h.user.id = :userId and h.store.isDeleted = false order by h.id desc") List findAllWithStoreByUserId(Long userId); }