woowacourse-teams / 2024-friendogly

강아지 사회화 장려 앱 반갑개 🐶
https://play.google.com/store/apps/details?id=com.happy.friendogly&hl=ko
17 stars 3 forks source link

채팅을 나가고 모임을 나가면 예외가 발생하는 버그 수정 #614

Closed takoyakimchi closed 1 month ago

takoyakimchi commented 1 month ago

요구 사항

// ChatRoom.removeMember()

public void removeMember(Member member) {
    ChatRoomMember chatRoomMember = chatRoomMembers.stream()
            .filter(row -> row.hasMember(member))
            .findAny()
            .orElseThrow(() -> new FriendoglyException("자신이 참여한 채팅방만 나갈 수 있습니다."));

    chatRoomMembers.remove(chatRoomMember);
}