Skip to content

Commit

Permalink
fix: 회원 가입 승인 시, 권한 수정이 안되는 에러
Browse files Browse the repository at this point in the history
  • Loading branch information
yangchef1 committed May 29, 2024
1 parent 59dc8e5 commit 4df427f
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.sanbosillok.sanbosillokserver.api.member.service;

import com.sanbosillok.sanbosillokserver.api.member.domain.Member;
import com.sanbosillok.sanbosillokserver.api.member.domain.MemberRole;
import com.sanbosillok.sanbosillokserver.api.member.dto.MemberResponse;
import com.sanbosillok.sanbosillokserver.api.member.repository.MemberRepository;
Expand All @@ -24,8 +25,10 @@ public List<MemberResponse> getInactiveMembers() {
}

public void activateMember(Long id) {
memberRepository.findById(id)
.orElseThrow(() -> new IllegalArgumentException("해당 회원 가입 신청이 존재하지 않습니다."))
.updateRole(MemberRole.ACTIVE);
Member member = memberRepository.findById(id)
.orElseThrow(() -> new IllegalArgumentException("해당 회원 가입 신청이 존재하지 않습니다."));

member.updateRole(MemberRole.ACTIVE);
memberRepository.save(member);
}
}

0 comments on commit 4df427f

Please sign in to comment.