From 860f7f49c7132c2b657d2cb88de5a5b03219a5c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=EC=86=8C=EB=AF=BC?= Date: Sun, 14 Sep 2025 16:33:00 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=EA=B8=B0=EB=B3=B8=EC=9D=B4=EB=AF=B8?= =?UTF-8?q?=EC=A7=80=20S3=EC=97=90=EC=84=9C=20=EC=82=AD=EC=A0=9C=20?= =?UTF-8?q?=EC=95=88=EB=90=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../example/ctrlu/domain/user/application/UserService.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/example/ctrlu/domain/user/application/UserService.java b/src/main/java/org/example/ctrlu/domain/user/application/UserService.java index f07b01f..ba807f5 100644 --- a/src/main/java/org/example/ctrlu/domain/user/application/UserService.java +++ b/src/main/java/org/example/ctrlu/domain/user/application/UserService.java @@ -55,7 +55,10 @@ public void updateProfile(Long userId, UpdateProfileRequest request) { profileImageKey = defaultImageKey; } - awsS3Service.deleteImage(user.getProfileImageKey()); + if (!user.getProfileImageKey().equals(defaultImageKey)) { + awsS3Service.deleteImage(user.getProfileImageKey()); + } + user.updateProfile(request.nickname(), profileImageKey); } From fb0bda4ecf154c693a16196f728254b9eb6735a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A0=95=EC=86=8C=EB=AF=BC?= Date: Sun, 14 Sep 2025 16:52:48 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=EC=9D=B4=EB=AF=B8=EC=A7=80=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=20=EC=95=88=ED=96=88=EC=9D=84=20=EB=95=8C=20?= =?UTF-8?q?=EB=A1=9C=EC=A7=81=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../example/ctrlu/domain/user/application/UserService.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/example/ctrlu/domain/user/application/UserService.java b/src/main/java/org/example/ctrlu/domain/user/application/UserService.java index ba807f5..8622783 100644 --- a/src/main/java/org/example/ctrlu/domain/user/application/UserService.java +++ b/src/main/java/org/example/ctrlu/domain/user/application/UserService.java @@ -51,7 +51,12 @@ public void updateProfile(Long userId, UpdateProfileRequest request) { .orElseThrow(() -> new UserException(NOT_FOUND_USER)); String profileImageKey = request.profileImageKey(); - if (profileImageKey == null || profileImageKey.isBlank()) { + if (profileImageKey.equals(user.getProfileImageKey())) { + user.updateProfile(request.nickname(), profileImageKey); + return; + } + + if (profileImageKey.isBlank()) { profileImageKey = defaultImageKey; }