Skip to content

Commit

Permalink
feat: 유저 탈퇴시 유저의 FCM 을 모두 삭제한다.
Browse files Browse the repository at this point in the history
  • Loading branch information
BGuga committed Sep 15, 2023
1 parent c20c05e commit bff5dd5
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,13 @@ public LoginMemberDto login(UserInfo userInfo, String fcmToken) {

private void enrollFcm(Member member, String fcmToken) {
// TODO : 멤버의 모든 FCM 을 지우지 않기 위해서는 멤버의 디바이스에 대한 식별자가 필요합니다.
deleteFCM(member);
memberFCMRepository.save(new MemberFCM(member, fcmToken));
}

private void deleteFCM(Member member) {
List<MemberFCM> originFCMs = memberFCMRepository.findByMemberId(member.getId());
memberFCMRepository.deleteAll(originFCMs);
memberFCMRepository.save(new MemberFCM(member, fcmToken));
}

private Member signUp(UserInfo userInfo) {
Expand All @@ -52,5 +56,6 @@ public void deleteMember(Long memberId) {
Member member = memberRepository.findById(memberId)
.orElseThrow(() -> new NotFoundException(ErrorCode.MEMBER_NOT_FOUND));
memberRepository.delete(member);
deleteFCM(member);
}
}

0 comments on commit bff5dd5

Please sign in to comment.