From 42d2168aba2a11f6f78a2b93d409d974aec2d09a Mon Sep 17 00:00:00 2001 From: juyeong-chungbuk Date: Sun, 1 Sep 2024 12:23:35 +0900 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20user.room=EC=9D=84=20=EC=A7=81?= =?UTF-8?q?=EC=A0=91=20=EB=B0=94=EA=BF=94=EC=A3=BC=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/room/meeting/meeting.service.ts | 2 +- src/room/room.service.ts | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/room/meeting/meeting.service.ts b/src/room/meeting/meeting.service.ts index 253f243..b2316e8 100644 --- a/src/room/meeting/meeting.service.ts +++ b/src/room/meeting/meeting.service.ts @@ -29,6 +29,6 @@ export class MeetingService { ) .then((result) => result.json()) .then((res) => res.data); - return result; + return result ?? []; } } diff --git a/src/room/room.service.ts b/src/room/room.service.ts index d9ccbfc..a555299 100644 --- a/src/room/room.service.ts +++ b/src/room/room.service.ts @@ -90,8 +90,8 @@ export class RoomService { const meetings = await this.meetingService.findByIdIn( rooms.map((room) => room.meeting.id), ); - rooms.forEach( - (room) => + user.rooms.forEach( + ({ room }) => (room.meeting = meetings.find( (meeting) => meeting.id === room.meeting.id, )), @@ -105,19 +105,23 @@ export class RoomService { senderId: string; }) { const sender = await this.userService.findById(chat.senderId); + const room = await this.repository.findOne({ _id: new Types.ObjectId(chat.roomId), }); + const createdChat = await this.chatService.sendChat({ content: { message: chat.message }, room: room._id, sender: sender, }); + const users = await this.userService.findByRoomId(room._id); await this.repository.findOneAndUpdate( { _id: room._id }, { $set: { lastChat: createdChat } }, ); + const result = new ChatDto(createdChat); this.detailGateway.io.server .of(`/chat-rooms/${chat.roomId}`) From 2f84e328070412e73c1b71209b34c1b5b6ae1c64 Mon Sep 17 00:00:00 2001 From: juyeong-chungbuk Date: Sun, 1 Sep 2024 12:23:46 +0900 Subject: [PATCH 2/3] =?UTF-8?q?chore:=20log=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/room/room.controller.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/room/room.controller.ts b/src/room/room.controller.ts index bcb6339..e6df617 100644 --- a/src/room/room.controller.ts +++ b/src/room/room.controller.ts @@ -53,7 +53,6 @@ export class RoomController { @Req() request: Request & { user: { id: string } }, ) { const chatRoom = await this.service.findDetail(roomId); - console.log(chatRoom); return new BaseResponse(new RoomDto(chatRoom, request.user.id)); } From 6c50a2640b8e77ddf9e35d1500c90976f8a1faed Mon Sep 17 00:00:00 2001 From: juyeong-chungbuk Date: Sun, 1 Sep 2024 12:24:31 +0900 Subject: [PATCH 3/3] =?UTF-8?q?chore:=20=EC=A3=BC=EC=84=9D=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.ts b/src/main.ts index 6ac5773..3007e2d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -9,6 +9,7 @@ import { AllExceptionsFilter } from './all/all.filter'; import * as https from 'https'; export const CONFIG_URL = `${process.env.SCHEME}://${process.env.ESC_CONFIG}${process.env.ESC_CONFIG_PORT}`; +// NOTE: dev사용 안하고 싶으면 https://api.meething.net로 바꿔서 사용 export const API_URL = `https://${process.env.ESC_API}${process.env.ESC_API_PORT}`; export async function bootstrap() {