Skip to content

Commit

Permalink
[HOTFIX] 멤버 조회시 본인 제외
Browse files Browse the repository at this point in the history
  • Loading branch information
ohksj77 committed Jan 13, 2024
1 parent 9739fea commit f610f22
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@
@Service
public class MemberService {
private final MemberRepository memberRepository;

private final AuthService authService;
private final MemberMapper memberMapper;

public MemberService(MemberRepository memberRepository, MemberMapper memberMapper) {
public MemberService(MemberRepository memberRepository, AuthService authService, MemberMapper memberMapper) {
this.memberRepository = memberRepository;
this.authService = authService;
this.memberMapper = memberMapper;
}

Expand All @@ -36,9 +37,10 @@ public Member getMemberById(UUID id) {
}

@Transactional(readOnly = true)
public List<MemberResponse> getMemberByNickname(String nickname) {
public List<MemberResponse> getMemberByNickname(final String nickname) {
final List<Member> members =
memberRepository.findAllByNicknameContainingIgnoreCase(nickname);
members.removeIf(authService.getMemberByJwt()::equals);
return getResponsesByMembers(members);
}

Expand Down

0 comments on commit f610f22

Please sign in to comment.