Skip to content

Commit

Permalink
Merge pull request #87 from AndLetgo/develop
Browse files Browse the repository at this point in the history
🚀 [DEPLOY]: 틈새 배포
  • Loading branch information
gyehwan24 authored Jan 17, 2024
2 parents 9186119 + 028d7f5 commit 208fe6c
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;

Expand Down Expand Up @@ -153,7 +154,8 @@ public ResponseEntity<?> deleteUser(UserPrincipal userPrincipal) {
List<Reply> replyByUser = replyRepository.findAllRepliesByUserId(userId);
for (Reply reply : replyByUser) {
Review review = reply.getReview();
review.updateNumReply(review.getNumReply() - 1);
if (reviewRepository.findReviewByReviewId(review.getId()) != null)
review.updateNumReply(review.getNumReply() - 1);
}
replyRepository.deleteAll(replyByUser);

Expand All @@ -164,6 +166,7 @@ public ResponseEntity<?> deleteUser(UserPrincipal userPrincipal) {
}

reviewRepository.deleteAll(reviews);
// reviewRepository.deleteAllInBatch(reviews);
interestRepository.deleteAll(interests);

// s3에서 프로필 이미지 삭제
Expand Down

0 comments on commit 208fe6c

Please sign in to comment.