From 06b7b191e66db7797ecc3cbcc8732e7e5287c7cd Mon Sep 17 00:00:00 2001 From: jun02160 Date: Tue, 7 May 2024 22:42:01 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20bugfix:=20=EC=B4=88=EB=8C=80?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=98=88=EC=99=B8=EC=B2=98=EB=A6=AC=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../parentchild/service/ParentchildService.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/motivoo-domain/src/main/java/sopt/org/motivoo/domain/parentchild/service/ParentchildService.java b/motivoo-domain/src/main/java/sopt/org/motivoo/domain/parentchild/service/ParentchildService.java index 1a3ed67..99ff476 100644 --- a/motivoo-domain/src/main/java/sopt/org/motivoo/domain/parentchild/service/ParentchildService.java +++ b/motivoo-domain/src/main/java/sopt/org/motivoo/domain/parentchild/service/ParentchildService.java @@ -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); @@ -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 생성)