public Member isPresentMemberByMemberId(Long memberId) {
Optional<Member> optionalMember = memberRepository.findById(memberId);
return optionalMember.orElseThrow(
() -> new CustomException(ErrorCode.MEMBER_NOT_FOUND)
);
는
public Member isPresentMemberByMemberId(Long memberId) {
return memberRepository.findById(memberId).orElseThrow(() -> new CustomException(ErrorCode.MEMBER_NOT_FOUND));
로 짧게 줄일 수 있다.