Skip to content

Commit

Permalink
fix: 이미지 생성 완료 메시지에서 tag가 빈 문자열일 때
Browse files Browse the repository at this point in the history
  • Loading branch information
BambooKim committed Jun 7, 2023
1 parent 4c0046c commit ff5792b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/main/java/grimuri/backend/domain/image/ImageService.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,13 @@ public void saveImageWithDiaryAndNotify(ImageRequestDto.Complete request) {
throw new ResponseStatusException(HttpStatus.NOT_FOUND, "User가 존재하지 않습니다.");
});

String tagStr = request.getTags().stream()
.map(tag -> tag.getEng() + ":" + tag.getKor())
.collect(Collectors.joining(","));
findDiary.saveTags(tagStr);
if (!request.getTags().isEmpty() && !(request.getTags() == null)) {
String tagStr = request.getTags().stream()
.map(tag -> tag.getEng() + ":" + tag.getKor())
.collect(Collectors.joining(","));
findDiary.saveTags(tagStr);
}

findDiary.setImageCreated(true);

request.getImages().forEach(image -> {
Expand Down

0 comments on commit ff5792b

Please sign in to comment.