Skip to content

Commit

Permalink
Merge tag '20240801-3' into develop
Browse files Browse the repository at this point in the history
   20240801-3
  • Loading branch information
dragontaek-lee committed Aug 1, 2024
2 parents 5b310b4 + 033f563 commit 0c8bce5
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,17 @@ public WorkEditResponseDTO updateWork(Long userId, WorkEditRequestDTO request) {
work.setTitle(request.title());
work.setDetail(request.detail());

if (!work.getPhotoUrl().equals(request.image())) {
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(request.image());
work.setPhotoUrl(image);
}

return WorkEditResponseDTO.of(workId);
Expand Down

0 comments on commit 0c8bce5

Please sign in to comment.