Skip to content

Commit

Permalink
[fix] 게시글 작성자 반환 에러 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
pagh2322 committed Apr 29, 2024
1 parent 88ab990 commit 4166b05
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public PostDetailResponse findPostById(long postId, AuthInfo authInfo) {
boolean liked = postLikeRepository.existsByPostAndMember(post, member);
boolean isMine = post.sameAuthor(member);
postRepository.increaseViewCount(postId);
return PostDetailResponse.of(post, member.getId(), liked, isMine);
return PostDetailResponse.of(post, liked, isMine);
}

public PostsResponse findMyPosts(AuthInfo authInfo, Pageable pageable) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ public PostDetailResponse(Long postId, String postTitle, String postContent,
this.viewCount = viewCount;
}

public static PostDetailResponse of(Post post, long memberId, boolean liked, boolean isMine) {
public static PostDetailResponse of(Post post, boolean liked, boolean isMine) {
return PostDetailResponse.builder()
.postId(post.getId())
.postTitle(post.getTitle())
.postContent(post.getContent())
.postCategory(post.getCategory().getValue())
.isMine(isMine)
.memberId(memberId)
.memberId(post.getMember().getId())
.postComments(post.getCommentCount())
.postLikes(post.getLikeCount())
.postTime(post.getCreatedAt())
Expand Down

0 comments on commit 4166b05

Please sign in to comment.