We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 13b0d3c + e394f6a commit fd38a89Copy full SHA for fd38a89
1 file changed
src/main/java/inu/codin/codin/domain/post/domain/comment/reply/service/ReplyQueryService.java
@@ -105,10 +105,15 @@ private CommentResponseDTO buildReplyResponseDTO(
105
}
106
107
public UserInfo getUserInfoAboutReply(ObjectId replyId) {
108
- ObjectId userId = SecurityUtils.getCurrentUserId();
109
- return UserInfo.ofComment(
110
- likeService.isLiked(LikeType.REPLY, replyId.toString(), userId)
111
- );
+ ObjectId userId = SecurityUtils.getCurrentUserIdOrNull();
+
+ boolean isLiked = false;
112
+ if (userId != null) {
113
+ isLiked = likeService.isLiked(LikeType.REPLY, replyId.toString(), userId);
114
+ }
115
116
+ return UserInfo.ofComment(isLiked);
117
118
119
/**
0 commit comments