From 95aa2f42c25618b490959353b5f472d3b258058e Mon Sep 17 00:00:00 2001 From: LJH Date: Mon, 13 May 2024 20:43:37 +0900 Subject: [PATCH 1/4] =?UTF-8?q?Feat(#501):=20=EA=B0=95=EC=9D=98=20preview?= =?UTF-8?q?=20not=20found=20exception?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lecture/services/lecture.service.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lecture/services/lecture.service.ts b/src/lecture/services/lecture.service.ts index 006c5e74..f4ca0145 100644 --- a/src/lecture/services/lecture.service.ts +++ b/src/lecture/services/lecture.service.ts @@ -248,6 +248,10 @@ export class LectureService { ? await this.lectureRepository.readLecture(lectureId, userId) : await this.lectureRepository.readLecture(lectureId); + if (!lecture) { + throw new NotFoundException('Lecture was not found', 'NotFoundLecture'); + } + return new LecturePreviewDto(lecture); } From 7b9bed2520ac69ea5e4ea7e804e113655552fda4 Mon Sep 17 00:00:00 2001 From: LJH Date: Mon, 13 May 2024 20:44:19 +0900 Subject: [PATCH 2/4] =?UTF-8?q?Feat(#501):=20=EA=B0=95=EC=9D=98=20detail?= =?UTF-8?q?=20not=20found=20exception?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lecture/services/lecture.service.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lecture/services/lecture.service.ts b/src/lecture/services/lecture.service.ts index f4ca0145..e7312d04 100644 --- a/src/lecture/services/lecture.service.ts +++ b/src/lecture/services/lecture.service.ts @@ -258,6 +258,10 @@ export class LectureService { async readLectureDetail(lectureId: number) { const lecture = await this.lectureRepository.readLecture(lectureId); + if (!lecture) { + throw new NotFoundException('Lecture was not found', 'NotFoundLecture'); + } + return new LectureDetailDto(lecture); } From 6a3656805a172e569104d535a453893e1b298811 Mon Sep 17 00:00:00 2001 From: LJH Date: Mon, 13 May 2024 20:47:12 +0900 Subject: [PATCH 3/4] Feat(#501): chat room not found exception --- src/chats/services/chats.service.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/chats/services/chats.service.ts b/src/chats/services/chats.service.ts index 94157e0e..2f8db56c 100644 --- a/src/chats/services/chats.service.ts +++ b/src/chats/services/chats.service.ts @@ -44,6 +44,10 @@ export class ChatsService { roomObjectId, ); + if (!chatRoom) { + throw new NotFoundException('ChatRoom was not found', 'NotFoundChatRoom'); + } + const userParticipation = chatRoom.user.participation; const lecturerParticipation = chatRoom.lecturer.participation; From 49d6b4b6d613e2b7c61c34cc3f67ab52b84ff089 Mon Sep 17 00:00:00 2001 From: LJH Date: Mon, 13 May 2024 20:52:56 +0900 Subject: [PATCH 4/4] =?UTF-8?q?Feat(#501):=20online=20=EC=A1=B4=EC=9E=AC?= =?UTF-8?q?=ED=95=A0=EB=96=84=EB=A7=8C=20=EC=95=8C=EB=A6=BC=20emit=20?= =?UTF-8?q?=EC=88=98=ED=96=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/chats/services/chats-room.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chats/services/chats-room.service.ts b/src/chats/services/chats-room.service.ts index 5df3d9bc..3ce6ae73 100644 --- a/src/chats/services/chats-room.service.ts +++ b/src/chats/services/chats-room.service.ts @@ -61,7 +61,7 @@ export class ChatRoomService { await Promise.all( onlineMap.map((online) => { - if (!online.lastLogin) { + if (online && !online.lastLogin) { this.eventsGateway.server .to(online.socketId) .emit('handleNewChatRoom', chatRoom.roomId);