Skip to content

Commit

Permalink
Merge pull request #31 from Team-Wable/feat/#30
Browse files Browse the repository at this point in the history
[FEAT] patch profile url logic
  • Loading branch information
Hong0329 authored Oct 8, 2024
2 parents cb85d27 + 8b5e0f1 commit 3205610
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

import java.io.IOException;
import java.util.List;
import java.util.Set;

@Service
@RequiredArgsConstructor
Expand Down Expand Up @@ -162,10 +163,10 @@ 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)) {
Set<String> allowedColors = Set.of("BLUE", "PURPLE", "GREEN");

if (!existedImage.isEmpty() && !allowedColors.contains(existedImage)) {
String existedKey = removeBaseUrl(existedImage, S3_URL);

s3Service.deleteImage(existedKey);
}
existingMember.updateProfileUrl(s3ImageUrl);
Expand Down

0 comments on commit 3205610

Please sign in to comment.