Skip to content

Commit

Permalink
Merge pull request #34 from MARKETFUBY/feat/product-detail
Browse files Browse the repository at this point in the history
[차소연] 상품 상세 조회에서 후기 이미지 리스트 수정
  • Loading branch information
Soyeon-Cha authored Nov 26, 2023
2 parents 96f7b57 + 74afa1d commit 34fc1eb
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/main/java/MARKETFUBY/Product/service/ProductService.java
Original file line number Diff line number Diff line change
Expand Up @@ -225,14 +225,13 @@ public ProductDetailDto getProductDetailDto(Product product, Long memberId){

public List<String> findReviewImagesByProduct(Product product) {
List<Review> reviewList = reviewRepository.findAllByProduct(product);
List<ReviewImage> reviewImageList = new ArrayList<>();
List<String> productReviewImageUrls = new ArrayList<>();
reviewList.forEach(review -> {
List<ReviewImage> reviewImageList1 = reviewImageRepository.findAllByReview(review);
reviewImageList.addAll(reviewImageList1);
});
reviewImageList.forEach(reviewImage -> {
productReviewImageUrls.add(reviewImage.getUrl());
List<ReviewImage> reviewImageList = reviewImageRepository.findAllByReview(review);
List<String> reviewImageUrls = reviewImageList.stream()
.map(ReviewImage::getUrl)
.collect(Collectors.toList());
productReviewImageUrls.addAll(reviewImageUrls);
});
return productReviewImageUrls;
}
Expand Down

0 comments on commit 34fc1eb

Please sign in to comment.