fix: add missing lifecycle hooks to the conversation

This commit is contained in:
Mohamed Marrouchi 2024-11-28 11:07:42 +01:00
parent aca92700de
commit 4fac552068

View File

@ -11,6 +11,7 @@ import { Transform, Type } from 'class-transformer';
import { Schema as MongooseSchema } from 'mongoose'; import { Schema as MongooseSchema } from 'mongoose';
import { BaseSchema } from '@/utils/generics/base-schema'; import { BaseSchema } from '@/utils/generics/base-schema';
import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager';
import { import {
TFilterPopulateFields, TFilterPopulateFields,
THydratedDocument, THydratedDocument,
@ -100,10 +101,10 @@ export class ConversationFull extends ConversationStub {
export type ConversationDocument = THydratedDocument<Conversation>; export type ConversationDocument = THydratedDocument<Conversation>;
export const ConversationModel: ModelDefinition = { export const ConversationModel: ModelDefinition = LifecycleHookManager.attach({
name: Conversation.name, name: Conversation.name,
schema: SchemaFactory.createForClass(ConversationStub), schema: SchemaFactory.createForClass(ConversationStub),
}; });
export default ConversationModel.schema; export default ConversationModel.schema;