From d3316ec34adc63c51a43b596aca67953ce4e71e0 Mon Sep 17 00:00:00 2001 From: Hong0329 Date: Sat, 31 Aug 2024 19:17:51 +0900 Subject: [PATCH] fix profile image patch logic --- .../api/member/service/MemberCommandService.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/WableServer/src/main/java/com/wable/www/WableServer/api/member/service/MemberCommandService.java b/WableServer/src/main/java/com/wable/www/WableServer/api/member/service/MemberCommandService.java index 42fdefd..a21f4f5 100644 --- a/WableServer/src/main/java/com/wable/www/WableServer/api/member/service/MemberCommandService.java +++ b/WableServer/src/main/java/com/wable/www/WableServer/api/member/service/MemberCommandService.java @@ -162,11 +162,12 @@ public void updateMemberProfile2(Long memberId, MultipartFile multipartFile, Pro try { String s3ImageUrl = s3Service.uploadImage(memberId.toString(), multipartFile); + if (!"BLUE".equals(existedImage) && !"PURPLE".equals(existedImage) && !"GREEN".equals(existedImage)) { - String existedKey = removeBaseUrl(existedImage, S3_URL); - - s3Service.deleteImage(existedKey); + String existedKey = removeBaseUrl(existedImage, S3_URL); + s3Service.deleteImage(existedKey); + } existingMember.updateProfileUrl(s3ImageUrl); } catch (IOException e) { throw new RuntimeException(e.getMessage());