Skip to content

Commit

Permalink
Merge pull request #164 from Team-Motivoo/chore/#162-home_reponse_data
Browse files Browse the repository at this point in the history
🐛 bugfix: 초대코드 예외처리 추가
  • Loading branch information
jun02160 committed May 7, 2024
2 parents 8ff1e23 + 06b7b19 commit b80f49d
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public InviteReceiveResult matchRelation(Long userId, InviteCommand request){
Parentchild parentchild = parentchildRetriever.getByInviteCode(request.inviteCode());
int count = userRetriever.getParentchildUserCnt(parentchild);
if (count == 1) {
// validateInviteRequest(user, parentchild);
validateInviteRequest(user, parentchild);
completeMatching(user, parentchild);
}
Long opponentUserId = userRetriever.getOpponentUserId(userId);
Expand All @@ -99,14 +99,14 @@ public InviteReceiveResult matchRelation(Long userId, InviteCommand request){
}

private void validateInviteRequest(User user, Parentchild parentchild) {
if (user.getParentchild().equals(parentchild)) {
if (user.getParentchild() != null && user.getParentchild().equals(parentchild)) {
throw new ParentchildException(MY_PARENTCHILD_INVITE);
}

int cntWithUser = userRetriever.getParentchildUserCnt(user.getParentchild());
parentchildManager.validateUserRelation(user, cntWithUser);
int cntWithInviteCode = userRetriever.getParentchildUserCnt(parentchild);
parentchildManager.validateInviteCode(parentchild, cntWithInviteCode);
// int cntWithUser = userRetriever.getParentchildUserCnt(user.getParentchild());
// parentchildManager.validateUserRelation(user, cntWithUser);
// int cntWithInviteCode = userRetriever.getParentchildUserCnt(parentchild);
// parentchildManager.validateInviteCode(parentchild, cntWithInviteCode);
}

// 초대코드 발급 및 전송하기 (Parentchild 생성)
Expand Down

0 comments on commit b80f49d

Please sign in to comment.