Skip to content

Commit

Permalink
fix: 체크리스트 조회 시 전체 목록 전달해주도록 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
Walkers15 committed Mar 17, 2024
1 parent a48891b commit ee1ce7d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void updateInfo(KakaoUserInfoResponse kakaoInfo, Member member) {

@Override
public MemberChecklist loadMemberChecklist(UUID memberId) {
return memberChecklistMapper.toDomain(memberChecklistRepository.findByChecklistInUsing(memberId));
return memberChecklistMapper.toDomain(memberChecklistRepository.findByMemberId(memberId));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ public interface MemberChecklistRepository extends JpaRepository<MemberChecklist

@Query("select mc from MemberChecklistEntity mc where mc.isUsed = true and mc.member.id = :memberId")
List<MemberChecklistEntity> findByChecklistInUsing(@Param("memberId") UUID memberId);

@Query("select mc from MemberChecklistEntity mc where mc.member.id = :memberId")
List<MemberChecklistEntity> findByMemberId(@Param("memberId") UUID memberId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ public class GetDetailMemberChecklistResponse {
@ApiModelProperty(name = "체크리스트 설명")
private final String criteria;

public GetDetailMemberChecklistResponse(Long id, String criteria) {
@ApiModelProperty(name = "사용 여부")
private final boolean isUsed;

public GetDetailMemberChecklistResponse(Long id, String criteria, boolean isUsed) {
this.id = id;
this.criteria = criteria;
this.isUsed = isUsed;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ public GetMemberChecklistResponse getMemberChecklistQuery(UUID memberId) {

List<GetDetailMemberChecklistResponse> badChecklist = memberChecklist.getBadChecklist()
.stream()
.map(ele -> new GetDetailMemberChecklistResponse(ele.getId(), ele.getCriteria()))
.map(ele -> new GetDetailMemberChecklistResponse(ele.getId(), ele.getCriteria(), ele.isUsed()))
.collect(Collectors.toList());

List<GetDetailMemberChecklistResponse> goodChecklist = memberChecklist.getGoodChecklist()
.stream()
.map(ele -> new GetDetailMemberChecklistResponse(ele.getId(), ele.getCriteria()))
.map(ele -> new GetDetailMemberChecklistResponse(ele.getId(), ele.getCriteria(), ele.isUsed()))
.collect(Collectors.toList());
return new GetMemberChecklistResponse(goodChecklist, badChecklist) ;
}
Expand Down

0 comments on commit ee1ce7d

Please sign in to comment.