diff --git a/packages/nocodb/src/app.module.ts b/packages/nocodb/src/app.module.ts index 93b61077a1..0cf3915ea9 100644 --- a/packages/nocodb/src/app.module.ts +++ b/packages/nocodb/src/app.module.ts @@ -1,4 +1,4 @@ -import { Inject, Module, RequestMethod } from '@nestjs/common' +import { Inject, Module, RequestMethod } from '@nestjs/common'; import { APP_FILTER } from '@nestjs/core'; import { Connection } from './connection/connection'; import { GlobalExceptionFilter } from './filters/global-exception/global-exception.filter'; @@ -7,13 +7,15 @@ import { GlobalMiddleware } from './middlewares/global/global.middleware'; import { GuiMiddleware } from './middlewares/gui/gui.middleware'; import { PublicMiddleware } from './middlewares/public/public.middleware'; import { DatasModule } from './modules/datas/datas.module'; -import { IEventEmitter } from './modules/event-emitter/event-emitter.interface' +import { IEventEmitter } from './modules/event-emitter/event-emitter.interface'; +import { EventEmitterModule } from './modules/event-emitter/event-emitter.module'; import { AuthService } from './services/auth.service'; import { UsersModule } from './modules/users/users.module'; import { MetaService } from './meta/meta.service'; import Noco from './Noco'; import { TestModule } from './modules/test/test.module'; import { GlobalModule } from './modules/global/global.module'; +import { HookHandlerService } from './services/hook-handler.service'; import { LocalStrategy } from './strategies/local.strategy'; import { AuthTokenStrategy } from './strategies/authtoken.strategy/authtoken.strategy'; import { BaseViewStrategy } from './strategies/base-view.strategy/base-view.strategy'; @@ -25,7 +27,6 @@ import type { MiddlewareConsumer, OnApplicationBootstrap, } from '@nestjs/common'; -import { HookHandlerService } from './services/hook-handler.service'; @Module({ imports: [ @@ -34,6 +35,7 @@ import { HookHandlerService } from './services/hook-handler.service'; ...(process.env['PLAYWRIGHT_TEST'] === 'true' ? [TestModule] : []), MetasModule, DatasModule, + EventEmitterModule, ], controllers: [], providers: [ diff --git a/packages/nocodb/src/modules/metas/metas.module.ts b/packages/nocodb/src/modules/metas/metas.module.ts index 13be9585a7..ea6bbd7a35 100644 --- a/packages/nocodb/src/modules/metas/metas.module.ts +++ b/packages/nocodb/src/modules/metas/metas.module.ts @@ -68,10 +68,10 @@ import { UtilsService } from '../../services/utils.service'; import { ViewColumnsService } from '../../services/view-columns.service'; import { ViewsService } from '../../services/views.service'; import { ApiDocsService } from '../../services/api-docs/api-docs.service'; +import { EventEmitterModule } from '../event-emitter/event-emitter.module' import { GlobalModule } from '../global/global.module'; import { ProjectUsersController } from '../../controllers/project-users.controller'; import { ProjectUsersService } from '../../services/project-users/project-users.service'; -import { DatasModule } from '../datas/datas.module'; @Module({ imports: [ diff --git a/packages/nocodb/src/services/hook-handler.service.ts b/packages/nocodb/src/services/hook-handler.service.ts index 1b50a6c39d..d7dac48aa4 100644 --- a/packages/nocodb/src/services/hook-handler.service.ts +++ b/packages/nocodb/src/services/hook-handler.service.ts @@ -1,4 +1,4 @@ -import { Injectable } from '@nestjs/common'; +import { Inject, Injectable } from '@nestjs/common' import { UITypes, ViewTypes } from 'nocodb-sdk'; import ejs from 'ejs'; import NcPluginMgrv2 from '../helpers/NcPluginMgrv2'; @@ -18,7 +18,7 @@ export const HANDLE_WEBHOOK = '__nc_handleHooks'; export class HookHandlerService implements OnModuleInit, OnModuleDestroy { private unsubscribe: () => void; - constructor(private readonly eventEmitter: IEventEmitter) {} + constructor(@Inject('IEventEmitter') private readonly eventEmitter: IEventEmitter) {} private async handleHooks({ hookName,