mirror of
https://github.com/hexastack/hexabot
synced 2024-12-26 13:53:12 +00:00
Merge pull request #402 from Hexastack/401-issue-missing-attached-entities
fix: attach botStats and nlpSampleEnitity to the lifecyclehook
This commit is contained in:
commit
85b696bebc
@ -9,6 +9,7 @@
|
||||
import { ModelDefinition, Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
||||
|
||||
import { BaseSchema } from '@/utils/generics/base-schema';
|
||||
import { LifecycleHookManager } from '@/utils/generics/lifecycle-hook-manager';
|
||||
import { THydratedDocument } from '@/utils/types/filter.types';
|
||||
|
||||
export enum BotStatsType {
|
||||
@ -115,9 +116,9 @@ export class BotStats extends BaseSchema {
|
||||
|
||||
export type BotStatsDocument = THydratedDocument<BotStats>;
|
||||
|
||||
export const BotStatsModel: ModelDefinition = {
|
||||
export const BotStatsModel: ModelDefinition = LifecycleHookManager.attach({
|
||||
name: BotStats.name,
|
||||
schema: SchemaFactory.createForClass(BotStats),
|
||||
};
|
||||
});
|
||||
|
||||
export default BotStatsModel.schema;
|
||||
|
@ -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,
|
||||
@ -103,10 +104,11 @@ export class NlpSampleEntityFull extends NlpSampleEntityStub {
|
||||
|
||||
export type NlpSampleEntityDocument = THydratedDocument<NlpSampleEntity>;
|
||||
|
||||
export const NlpSampleEntityModel: ModelDefinition = {
|
||||
name: NlpSampleEntity.name,
|
||||
schema: SchemaFactory.createForClass(NlpSampleEntityStub),
|
||||
};
|
||||
export const NlpSampleEntityModel: ModelDefinition =
|
||||
LifecycleHookManager.attach({
|
||||
name: NlpSampleEntity.name,
|
||||
schema: SchemaFactory.createForClass(NlpSampleEntityStub),
|
||||
});
|
||||
|
||||
export default NlpSampleEntityModel.schema;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user