mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
feat: centrelize eventEmitter
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright © 2024 Hexastack. All rights reserved.
|
||||
* Copyright © 2025 Hexastack. All rights reserved.
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
|
||||
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
|
||||
@@ -7,7 +7,6 @@
|
||||
*/
|
||||
|
||||
import { ForbiddenException, Injectable, Optional } from '@nestjs/common';
|
||||
import { EventEmitter2 } from '@nestjs/event-emitter';
|
||||
import { InjectModel } from '@nestjs/mongoose';
|
||||
import { Document, Model, Query } from 'mongoose';
|
||||
|
||||
@@ -27,12 +26,11 @@ export class ContentTypeRepository extends BaseRepository<
|
||||
ContentTypeDto
|
||||
> {
|
||||
constructor(
|
||||
readonly eventEmitter: EventEmitter2,
|
||||
@InjectModel(ContentType.name) readonly model: Model<ContentType>,
|
||||
@InjectModel(Content.name) private readonly contentModel: Model<Content>,
|
||||
@Optional() private readonly blockService?: BlockService,
|
||||
) {
|
||||
super(eventEmitter, model, ContentType);
|
||||
super(model, ContentType);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright © 2024 Hexastack. All rights reserved.
|
||||
* Copyright © 2025 Hexastack. All rights reserved.
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
|
||||
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
|
||||
@@ -7,7 +7,6 @@
|
||||
*/
|
||||
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { EventEmitter2 } from '@nestjs/event-emitter';
|
||||
import { InjectModel } from '@nestjs/mongoose';
|
||||
import {
|
||||
Document,
|
||||
@@ -36,11 +35,8 @@ export class ContentRepository extends BaseRepository<
|
||||
ContentFull,
|
||||
ContentDto
|
||||
> {
|
||||
constructor(
|
||||
readonly eventEmitter: EventEmitter2,
|
||||
@InjectModel(Content.name) readonly model: Model<Content>,
|
||||
) {
|
||||
super(eventEmitter, model, Content, CONTENT_POPULATE, ContentFull);
|
||||
constructor(@InjectModel(Content.name) readonly model: Model<Content>) {
|
||||
super(model, Content, CONTENT_POPULATE, ContentFull);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright © 2024 Hexastack. All rights reserved.
|
||||
* Copyright © 2025 Hexastack. All rights reserved.
|
||||
*
|
||||
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
|
||||
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
|
||||
@@ -7,7 +7,6 @@
|
||||
*/
|
||||
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { EventEmitter2 } from '@nestjs/event-emitter';
|
||||
import { InjectModel } from '@nestjs/mongoose';
|
||||
import { Model } from 'mongoose';
|
||||
|
||||
@@ -30,11 +29,8 @@ export class MenuRepository extends BaseRepository<
|
||||
MenuFull,
|
||||
MenuDto
|
||||
> {
|
||||
constructor(
|
||||
readonly eventEmitter: EventEmitter2,
|
||||
@InjectModel(Menu.name) readonly model: Model<Menu>,
|
||||
) {
|
||||
super(eventEmitter, model, Menu, MENU_POPULATE, MenuFull);
|
||||
constructor(@InjectModel(Menu.name) readonly model: Model<Menu>) {
|
||||
super(model, Menu, MENU_POPULATE, MenuFull);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user