Skip to content

Commit

Permalink
fix: member조회할 때 삭제되지 않은 member 조회하게 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
minsu20 committed Nov 18, 2023
1 parent e930beb commit cfc0748
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ public interface MemberCustomRepository {
Optional<Member> findNotDeletedBySocialId(String socialId);

Optional<Member> findNotDeletedByEmail(String email);
Optional<Member> findNotDeletedByMemberId(Long id);
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,13 @@ public Optional<Member> findNotDeletedByEmail(String email) {
.where(member.isDeleted.eq(false))
.fetchOne());
}

@Override
public Optional<Member> findNotDeletedByMemberId(Long id) {
return Optional.ofNullable(queryFactory
.selectFrom(member)
.where(member.memberId.eq(id))
.where(member.isDeleted.eq(false))
.fetchOne());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public Member getMemberBySocialId(String socialId){
}

public Member getMemberByMemberId(Long memberId) {
return memberRepository.findByMemberId(memberId).orElseThrow(()->new NotFoundBySocialIdException());
return memberRepository.findNotDeletedByMemberId(memberId).orElseThrow(()->new NotFoundBySocialIdException());
}
}

0 comments on commit cfc0748

Please sign in to comment.