diff --git a/src/main/java/com/example/betteriter/fo_domain/review/service/ReviewService.java b/src/main/java/com/example/betteriter/fo_domain/review/service/ReviewService.java index afcb83b..c400409 100644 --- a/src/main/java/com/example/betteriter/fo_domain/review/service/ReviewService.java +++ b/src/main/java/com/example/betteriter/fo_domain/review/service/ReviewService.java @@ -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) { @@ -457,10 +457,13 @@ private void updateReviewImages(Review review, List imageList) { List nowReviewImages = review.getReviewImages(); reviewImageRepository.deleteAll(nowReviewImages); - List 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 nowReviewSpecDataList,