Skip to content

Commit

Permalink
refactor: #39 edit
Browse files Browse the repository at this point in the history
  • Loading branch information
dyk-im committed Nov 13, 2024
1 parent f188e8b commit b119205
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,4 @@ public static ArticleResponseDto from(Article article, boolean isOwner, boolean
.createdAt(article.getCreatedAt())
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,9 @@ public List<ArticleResponseDto> getArticles(HttpServletRequest request, LocalDat
.map(article -> {
boolean isOwner = article.getWriter().getUserId().equals(user.getUserId());
ArticleStatsDto stats = findArticleStats(article);
return ArticleResponseDto.from(article, isOwner, stats, replyStatsMap);
boolean isLiked = articleLikeRepository.existsByArticle_ArticleIdAndUser_UserIdAndDeletedStatus(
article.getArticleId(), user.getUserId(), DeletedStatus.NOT_DELETED);
return ArticleResponseDto.from(article, isOwner, isLiked, stats, replyStatsMap);
})
.collect(Collectors.toList());
}
Expand Down

0 comments on commit b119205

Please sign in to comment.