diff --git a/src/main/java/com/dnd/dndtravel/map/controller/MapController.java b/src/main/java/com/dnd/dndtravel/map/controller/MapController.java index 0cd11a6..7b6565e 100644 --- a/src/main/java/com/dnd/dndtravel/map/controller/MapController.java +++ b/src/main/java/com/dnd/dndtravel/map/controller/MapController.java @@ -67,11 +67,6 @@ public void updateRecord( mapService.updateVisitRecord(updateRecordRequest.toDto(photos), authenticationMember.id(), recordId); } - // 기록 삭제 - - /** - * org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'DELETE' is not supported 예외로 인해 PostMapping으로 변경 - */ @DeleteMapping("/maps/history/{recordId}") public void deleteRecord( AuthenticationMember authenticationMember, diff --git a/src/main/java/com/dnd/dndtravel/map/service/MapService.java b/src/main/java/com/dnd/dndtravel/map/service/MapService.java index be0bb86..7c9a42e 100644 --- a/src/main/java/com/dnd/dndtravel/map/service/MapService.java +++ b/src/main/java/com/dnd/dndtravel/map/service/MapService.java @@ -172,6 +172,7 @@ public void deleteRecord(long memberId, long memberAttractionId) { List photos = photoRepository.findByMemberAttractionId(memberAttraction.getId()); photoRepository.deleteAll(photos); memberAttractionRepository.delete(memberAttraction); + memberRegionRepository.deleteById(memberAttraction.getMember().getId()); attractionRepository.deleteById(memberAttraction.getAttraction().getId()); } diff --git a/src/main/java/com/dnd/dndtravel/map/service/PhotoService.java b/src/main/java/com/dnd/dndtravel/map/service/PhotoService.java index 13284ec..92d4778 100644 --- a/src/main/java/com/dnd/dndtravel/map/service/PhotoService.java +++ b/src/main/java/com/dnd/dndtravel/map/service/PhotoService.java @@ -45,7 +45,7 @@ public String upload(MultipartFile image) { public void deleteS3Photo(List existingUrls) { for (String existingPhotoUrl : existingUrls) { // 기존 이미지 URL에서 파일 이름 추출 - String existingFileName = existingPhotoUrl.substring(existingPhotoUrl.lastIndexOf('/') + 1);; + String existingFileName = existingPhotoUrl.substring(existingPhotoUrl.lastIndexOf('/') + 1); // S3에서 기존 이미지 삭제 try {