Skip to content

Commit 614ebce

Browse files
authored
hotfix : 파티 삭제 되지 않는 문제 수정 #86 (#87)
1 parent 7c04a19 commit 614ebce

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

src/main/java/ita/tinybite/domain/chat/repository/ChatRoomRepository.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010

1111
@Repository
1212
public interface ChatRoomRepository extends JpaRepository<ChatRoom, Long> {
13-
1413
Optional<ChatRoom> findByPartyAndType(Party party, ChatRoomType type);
1514

15+
void deleteByPartyIdAndType(Long partyId, ChatRoomType type);
16+
1617
}

src/main/java/ita/tinybite/domain/party/repository/PartyRepository.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package ita.tinybite.domain.party.repository;
22

33
import io.lettuce.core.dynamic.annotation.Param;
4+
import ita.tinybite.domain.chat.enums.ChatRoomType;
45
import ita.tinybite.domain.party.entity.Party;
56
import ita.tinybite.domain.party.enums.PartyCategory;
67
import java.util.List;

src/main/java/ita/tinybite/domain/party/service/PartyService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,8 @@ public void deleteParty(Long partyId, Long userId) {
386386
throw new IllegalStateException("승인된 파티원이 있어 삭제할 수 없습니다");
387387
}
388388

389+
chatRoomRepository.deleteByPartyIdAndType(partyId, ChatRoomType.GROUP);
390+
389391
// 삭제 실행
390392
partyRepository.delete(party);
391393
}

0 commit comments

Comments
 (0)