Skip to content

Commit

Permalink
♻️ 쪽지 답장 리팩토링
Browse files Browse the repository at this point in the history
  • Loading branch information
tjdals4716 committed Nov 1, 2024
1 parent 0a84ab4 commit 4907bbc
Showing 1 changed file with 0 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,9 @@ public MessageDTO replyMessage(Long messageId, String uid, Long bucketListId, Me
UserEntity sender = userRepository.findByUid(uid);
UserEntity receiver = originalMessage.getSender();
BucketlistEntity bucketList = bucketRepository.findById(bucketListId).orElseThrow();
// 원본 쪽지가 해당 버킷리스트에서 생성된 쪽지인지 확인
if (!originalMessage.getBucketList().getId().equals(bucketListId)) {
throw new RuntimeException("해당 버킷리스트에서 생성된 쪽지에만 답장할 수 있습니다.");
}
// 원본 쪽지의 발신자에게만 답장을 허용
if (!originalMessage.getReceiver().getUid().equals(uid)) {
throw new RuntimeException("원본 쪽지의 발신자에게만 답장을 보낼 수 있습니다.");
}
Expand Down

0 comments on commit 4907bbc

Please sign in to comment.