Browse Source

fix: set injection key and add event emitter module

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5597/head
Pranav C 2 years ago
parent
commit
b55031fd87
  1. 8
      packages/nocodb/src/app.module.ts
  2. 2
      packages/nocodb/src/modules/metas/metas.module.ts
  3. 4
      packages/nocodb/src/services/hook-handler.service.ts

8
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: [

2
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: [

4
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,

Loading…
Cancel
Save