Skip to content

Commit

Permalink
fix: 작업 사진 수정 시 같은 사진일 때 유저 값 변경하지 않도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
dragontaek-lee committed Aug 1, 2024
1 parent 033f563 commit 0f7d7f2
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,15 @@ public WorkEditResponseDTO updateWork(Long userId, WorkEditRequestDTO request) {

val image = request.image();

if (work.isFirst()) {
val user = findUser(userId);
user.setWorkThumbNail(image);
}

if (!work.getPhotoUrl().equals(image)) {
val deletePhotoUrl = work.getPhotoUrl();
s3Service.deleteS3Image(deletePhotoUrl);
work.setPhotoUrl(image);

if (work.isFirst()) {
val user = findUser(userId);
user.setWorkThumbNail(image);
}
}

return WorkEditResponseDTO.of(workId);
Expand Down

0 comments on commit 0f7d7f2

Please sign in to comment.