Skip to content

Commit

Permalink
fix: 커뮤니티 댓글 푸시알림 타이틀 없는 경우 처리 (#297)
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-Crayon authored Dec 8, 2023
1 parent 8acf6cb commit 85aab58
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import lombok.val;
import org.apache.commons.lang3.StringUtils;
import org.sopt.makers.internal.domain.community.CommunityComment;
import org.sopt.makers.internal.domain.community.ReportComment;
import org.sopt.makers.internal.dto.community.CommentDao;
Expand Down Expand Up @@ -62,7 +63,13 @@ public void createComment(Long writerId, Long postId, CommentSaveRequest request
if (post.getMember().getId().equals(writerId)) return;

try {
String pushNotificationContent = "\"" + post.getTitle() + "\"" + " 글에 댓글이 달렸어요.";
String title = post.getTitle();
String content = post.getContent();

if (StringUtils.isBlank(title)) {
title = StringUtils.abbreviate(content, 20) + "...";
}
String pushNotificationContent = "\"" + title + "\"" + " 글에 댓글이 달렸어요.";

PushNotificationRequest pushNotificationRequest = PushNotificationRequest.builder()
.title("")
Expand Down

0 comments on commit 85aab58

Please sign in to comment.