From 3ea9bfe10597842fbfcffe722ba18dcda398424d Mon Sep 17 00:00:00 2001 From: overthestream Date: Wed, 28 Aug 2024 02:35:15 +0900 Subject: [PATCH] fix chatroom --- src/domain/chat/chat.service.ts | 1 + src/domain/chat/models/room.model.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/domain/chat/chat.service.ts b/src/domain/chat/chat.service.ts index 96b0cbf..9f94d8e 100644 --- a/src/domain/chat/chat.service.ts +++ b/src/domain/chat/chat.service.ts @@ -108,6 +108,7 @@ export class ChatService { users: users, blur: 0, connected: true, + continued: false, connectedAt: getDateTimeOfNow(), freeExpired: free ? false : null, }); diff --git a/src/domain/chat/models/room.model.ts b/src/domain/chat/models/room.model.ts index 509669a..4e234ab 100644 --- a/src/domain/chat/models/room.model.ts +++ b/src/domain/chat/models/room.model.ts @@ -6,6 +6,7 @@ import { ChatUserDto } from 'src/domain/chat/dtos'; const options: SchemaOptions = { id: false, collection: 'room', + autoCreate: true, }; const ChatUser = new MongooseSchema( @@ -38,7 +39,7 @@ export class Room extends Document { @Prop({ required: true, type: Boolean, - default: true, + default: false, }) @IsBoolean() continued: boolean;