diff --git a/src/main/java/com/depromeet/domain/image/application/ImageService.java b/src/main/java/com/depromeet/domain/image/application/ImageService.java index 71825692a..122d8019c 100644 --- a/src/main/java/com/depromeet/domain/image/application/ImageService.java +++ b/src/main/java/com/depromeet/domain/image/application/ImageService.java @@ -102,12 +102,14 @@ public PresignedUrlResponse createMemberProfilePresignedUrl( public void uploadCompleteMemberProfile(MemberProfileImageUploadCompleteRequest request) { final Member currentMember = memberUtil.getCurrentMember(); - - String imageUrl = - createImageUrl( - ImageType.MEMBER_PROFILE, - currentMember.getId(), - request.imageFileExtension()); + String imageUrl = null; + if (request.imageFileExtension() != null) { + imageUrl = + createImageUrl( + ImageType.MEMBER_PROFILE, + currentMember.getId(), + request.imageFileExtension()); + } currentMember.updateProfile(Profile.createProfile(request.nickname(), imageUrl)); } diff --git a/src/main/java/com/depromeet/domain/image/dto/request/MemberProfileImageUploadCompleteRequest.java b/src/main/java/com/depromeet/domain/image/dto/request/MemberProfileImageUploadCompleteRequest.java index 9e8d4ac83..571649213 100644 --- a/src/main/java/com/depromeet/domain/image/dto/request/MemberProfileImageUploadCompleteRequest.java +++ b/src/main/java/com/depromeet/domain/image/dto/request/MemberProfileImageUploadCompleteRequest.java @@ -5,7 +5,7 @@ import jakarta.validation.constraints.NotNull; public record MemberProfileImageUploadCompleteRequest( - @NotNull(message = "이미지 파일의 확장자는 비워둘 수 없습니다.") - @Schema(description = "이미지 파일의 확장자", defaultValue = "JPEG") + @Schema(description = "이미지 파일의 확장자", defaultValue = "JPEG") ImageFileExtension imageFileExtension, - @Schema(description = "닉네임", defaultValue = "당근조이") String nickname) {} + @NotNull(message = "닉네임은 비워둘 수 없습니다.") @Schema(description = "닉네임", defaultValue = "당근조이") + String nickname) {}