Skip to content

Commit

Permalink
Merge pull request #65 from nick102030/view
Browse files Browse the repository at this point in the history
[fix] : s3 이미지 삭제 안되던 오류 수정
  • Loading branch information
nick102030 authored Jun 4, 2024
2 parents 8dd5548 + ccd6a34 commit edfccb4
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/main/java/com/example/jolvre/post/service/PostService.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,11 @@ public void deletePost(Long postId, User user) {
throw new UserAccessDeniedException();
}
else {
if (!CollectionUtils.isNullOrEmpty(post.getImageUrls())) {
int i = 0;
while (i < post.getImageUrls().size()) {
s3Service.deleteImage(post.getImageUrls().get(i));
i++;
log.info("{} 번째 이미지 삭제", i);
}
int i = 0;
while (i < post.getImageUrls().size()) {
s3Service.deleteImage(post.getImageUrls().get(i));
i++;
log.info("{} 번째 이미지 삭제", i);
}
postRepository.deleteById(postId);
log.info("[post] : {} 게시글 삭제 완료", postId);
Expand Down

0 comments on commit edfccb4

Please sign in to comment.