-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] TalkRoom 삭제 API 구현 #37
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
확인했습니다.
수고하셨습니다. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다!
코멘트 남겼으니 확인 부탁드립니다!!
Optional<Comment> comment = commentRepository.findByTalkRoom(talkRoom); | ||
comment.ifPresent(commentRepository::delete); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
위 코드는 아래와 같이도 작성할 수 있습니다!!
Optional<Comment> comment = commentRepository.findByTalkRoom(talkRoom)
.ifPresent(commentRepository::delete);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오 그렇군요~
수정 후 다시 코드 올리도록 하겠습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
머지 허용 했습니다. 고생하셨습니다 👍
@@ -103,8 +101,7 @@ public void deleteTalkRoom(Long talkRoomId, Long userId) { | |||
throw new BusinessException(ErrorCode.UNAUTHORIZED_REQUEST); | |||
} | |||
|
|||
Optional<Comment> comment = commentRepository.findByTalkRoom(talkRoom); | |||
comment.ifPresent(commentRepository::delete); | |||
commentRepository.findByTalkRoom(talkRoom).ifPresent(commentRepository::delete); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
확인 했습니다!!
💡 연관된 이슈
close #36
📝 작업 내용
💬 리뷰 요구 사항
TalkRoom_ID
와Auth
정보를 받아온다.TalkRoom_ID
를 바탕으로 해당TalkRoom
을 조회 후TalkRoom
을 생성한User_ID
와Auth_ID
비교 후 일치하면TalkRoom
을 삭제한다.