Skip to content
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

Merged
merged 3 commits into from
Mar 25, 2024

Conversation

AHNYUNKI
Copy link
Member

@AHNYUNKI AHNYUNKI commented Mar 25, 2024

💡 연관된 이슈

close #36

📝 작업 내용

  • TalkRoom 삭제 API 구현
  • TalkRoom 삭제 API 테스트 코드 작성

💬 리뷰 요구 사항

  1. 프론트 단에서 TalkRoom_IDAuth 정보를 받아온다.
  2. TalkRoom_ID를 바탕으로 해당 TalkRoom을 조회 후 TalkRoom을 생성한 User_IDAuth_ID 비교 후 일치하면 TalkRoom을 삭제한다.

@AHNYUNKI AHNYUNKI added the ✨ Feature 기능 개발 label Mar 25, 2024
@AHNYUNKI AHNYUNKI requested review from pdohyung and jwooo March 25, 2024 09:01
@AHNYUNKI AHNYUNKI self-assigned this Mar 25, 2024
@AHNYUNKI AHNYUNKI linked an issue Mar 25, 2024 that may be closed by this pull request
2 tasks
Copy link
Member

@pdohyung pdohyung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인했습니다.
수고하셨습니다. 👍

Copy link
Collaborator

@jwooo jwooo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다!

코멘트 남겼으니 확인 부탁드립니다!!

Comment on lines 106 to 107
Optional<Comment> comment = commentRepository.findByTalkRoom(talkRoom);
comment.ifPresent(commentRepository::delete);
Copy link
Collaborator

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);

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오 그렇군요~
수정 후 다시 코드 올리도록 하겠습니다!

Copy link
Collaborator

@jwooo jwooo left a 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);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인 했습니다!!

@AHNYUNKI AHNYUNKI merged commit a7227bc into develop Mar 25, 2024
1 check passed
@AHNYUNKI AHNYUNKI deleted the feature/36-talkroom-delete-api branch March 25, 2024 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feature 기능 개발
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] TalkRoom 삭제 API 구현
3 participants