Skip to content

Commit

Permalink
[FIX] isLiked 필드가 null로 반환 되는 오류 (#160)
Browse files Browse the repository at this point in the history
* refactor: isLiked 필드 제거

* refactor: isLiked 기본값 false 설정

* comment: 필요없는 주석 제거(반환 값 명시해주는 주석)
  • Loading branch information
injae-348 authored Sep 23, 2024
1 parent 41d56a2 commit f12b997
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/java/econo/buddybridge/post/dto/PostResDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public PostResDto(Post post) {
post.getModifiedAt(),
post.getPostStatus(),
post.getDisabilityType(),
post.getIsLiked()
false
);
}

Expand Down
2 changes: 0 additions & 2 deletions src/main/java/econo/buddybridge/post/entity/Post.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ public class Post extends BaseEntity {
@OneToMany(mappedBy = "post", orphanRemoval = true, cascade = CascadeType.ALL)
private final List<Comment> comments = new ArrayList<>();

private Boolean isLiked = false;

public void changeStatus(PostStatus status){ // 상태 변경
this.postStatus = status;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ public PostCustomPage findPosts(Long memberId, Integer page, Integer size, Strin
buildPostDisabilityTypeExpression(disabilityType), buildPostAssistanceTypeExpression(assistanceType))
.fetchOne();

// content, totalElements, last
return new PostCustomPage(content, totalElements, content.size() < size);
}

Expand Down

0 comments on commit f12b997

Please sign in to comment.