From 4fac552068e87c6060c455a21f466acb605286ab Mon Sep 17 00:00:00 2001 From: Mohamed Marrouchi Date: Thu, 28 Nov 2024 11:07:42 +0100 Subject: [PATCH] fix: add missing lifecycle hooks to the conversation --- api/src/chat/schemas/conversation.schema.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/src/chat/schemas/conversation.schema.ts b/api/src/chat/schemas/conversation.schema.ts index 50fb33b..7880c0c 100644 --- a/api/src/chat/schemas/conversation.schema.ts +++ b/api/src/chat/schemas/conversation.schema.ts @@ -11,6 +11,7 @@ import { Transform, Type } from 'class-transformer'; import { Schema as MongooseSchema } from 'mongoose'; import { BaseSchema } from '@/utils/generics/base-schema'; +import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager'; import { TFilterPopulateFields, THydratedDocument, @@ -100,10 +101,10 @@ export class ConversationFull extends ConversationStub { export type ConversationDocument = THydratedDocument; -export const ConversationModel: ModelDefinition = { +export const ConversationModel: ModelDefinition = LifecycleHookManager.attach({ name: Conversation.name, schema: SchemaFactory.createForClass(ConversationStub), -}; +}); export default ConversationModel.schema;