We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 4145cbc + 135df37 commit 83a2e3eCopy full SHA for 83a2e3e
1 file changed
src/main/java/inu/codin/codin/domain/post/domain/comment/service/CommentQueryService.java
@@ -113,10 +113,14 @@ private CommentResponseDTO buildCommentResponseDTO(
113
114
115
public UserInfo getUserInfoAboutComment(ObjectId commentId) {
116
- ObjectId userId = SecurityUtils.getCurrentUserId();
117
- return UserInfo.ofComment(
118
- likeService.isLiked(LikeType.COMMENT, commentId.toString(), userId)
119
- );
+ ObjectId userId = SecurityUtils.getCurrentUserIdOrNull();
+
+ boolean isLiked = false;
+ if (userId != null) {
120
+ isLiked = likeService.isLiked(LikeType.COMMENT, commentId.toString(), userId);
121
+ }
122
123
+ return UserInfo.ofComment(isLiked);
124
}
125
/**
126
*
0 commit comments