File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,13 @@ export const ChatroomRepository = {
2222 } ) ;
2323 } ,
2424
25+ async reactivateChatroom ( chatroomId , updateData ) {
26+ return await prisma . chatroom . update ( {
27+ where : { id : chatroomId } ,
28+ data : updateData ,
29+ } ) ;
30+ } ,
31+
2532 async findChatroomsByUser ( account ) {
2633 // 1. 채팅방 기본 정보 + 마지막 메시지(내용, 생성시간, id) 조회
2734 let chatrooms ;
Original file line number Diff line number Diff line change @@ -26,14 +26,20 @@ export const ChatroomService = {
2626 }
2727
2828 // 채팅방 중복 확인
29- const existing = await ChatroomRepository . findChatroomByUsersAndCommission (
29+ let existing = await ChatroomRepository . findChatroomByUsersAndCommission (
3030 dto . userId ,
3131 dto . artistId ,
3232 dto . commissionId
3333 ) ;
3434
3535 // 기존 채팅방 반환
3636 if ( existing ) {
37+ if ( existing . hiddenUser || existing . hiddenArtist ) {
38+ existing = await ChatroomRepository . reactivateChatroom ( existing . id , {
39+ hiddenUser : false ,
40+ hiddenArtist : false ,
41+ } ) ;
42+ }
3743 return existing ;
3844 }
3945
You can’t perform that action at this time.
0 commit comments