Skip to content

Commit

Permalink
FIX: 문제 임시 해결
Browse files Browse the repository at this point in the history
<footer>
- 관련: #193
  • Loading branch information
luke0408 committed Mar 5, 2024
1 parent 2adecaf commit 2f4c4df
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ public void updateReview(Long reviewId, UpdateReviewRequestDto request) {

reviewRepository.save(review);

this.clearS3ReviewImage(review);
// this.clearS3ReviewImage(review);
}

private void clearS3ReviewImage(Review review) {
Expand All @@ -457,10 +457,13 @@ private void updateReviewImages(Review review, List<String> imageList) {
List<ReviewImage> nowReviewImages = review.getReviewImages();
reviewImageRepository.deleteAll(nowReviewImages);

List<ReviewImage> newReviewImages = imageList.stream()
.map(image -> ReviewImage.createReviewImage(review, image, imageList.indexOf(image)))
.collect(Collectors.toList());
reviewImageRepository.saveAll(newReviewImages);
for (int i = 0; i < imageList.size(); i++) {
reviewImageRepository.save(ReviewImage.builder()
.review(review)
.imgUrl(imageList.get(i))
.orderNum(i)
.build());
}
}

private void updateReviewSpecData(Review review, List<ReviewSpecData> nowReviewSpecDataList,
Expand Down

0 comments on commit 2f4c4df

Please sign in to comment.