From ac825edbe354d0ce93c57aaa80a6b3e625cc26da Mon Sep 17 00:00:00 2001 From: Tilman Vatteroth Date: Fri, 16 Jun 2023 22:49:45 +0200 Subject: [PATCH] fix: replace RouterModule from nest-router with @nestjs/core Signed-off-by: Tilman Vatteroth --- backend/package.json | 1 - backend/src/app.module.ts | 4 ++-- backend/test/test-setup.ts | 4 ++-- yarn.lock | 8 -------- 4 files changed, 4 insertions(+), 13 deletions(-) diff --git a/backend/package.json b/backend/package.json index dfcf152a2..f18ffdcc9 100644 --- a/backend/package.json +++ b/backend/package.json @@ -60,7 +60,6 @@ "ldapauth-fork": "5.0.5", "minio": "7.1.1", "mysql": "2.18.1", - "nest-router": "1.0.9", "node-fetch": "2.6.11", "passport": "0.6.0", "passport-custom": "1.1.1", diff --git a/backend/src/app.module.ts b/backend/src/app.module.ts index 7dab48e03..5b456585c 100644 --- a/backend/src/app.module.ts +++ b/backend/src/app.module.ts @@ -5,10 +5,10 @@ */ import { Module } from '@nestjs/common'; import { ConfigModule } from '@nestjs/config'; +import { RouterModule, Routes } from '@nestjs/core'; import { EventEmitterModule } from '@nestjs/event-emitter'; import { ScheduleModule } from '@nestjs/schedule'; import { TypeOrmModule } from '@nestjs/typeorm'; -import { RouterModule, Routes } from 'nest-router'; import { PrivateApiModule } from './api/private/private-api.module'; import { PublicApiModule } from './api/public/public-api.module'; @@ -53,7 +53,7 @@ const routes: Routes = [ @Module({ imports: [ - RouterModule.forRoutes(routes), + RouterModule.register(routes), TypeOrmModule.forRootAsync({ imports: [ConfigModule, LoggerModule], inject: [databaseConfig.KEY, TypeormLoggerService], diff --git a/backend/test/test-setup.ts b/backend/test/test-setup.ts index 0dcdfe405..5f0fc4670 100644 --- a/backend/test/test-setup.ts +++ b/backend/test/test-setup.ts @@ -4,11 +4,11 @@ * SPDX-License-Identifier: AGPL-3.0-only */ import { ConfigModule, ConfigService } from '@nestjs/config'; +import { RouterModule, Routes } from '@nestjs/core'; import { EventEmitterModule } from '@nestjs/event-emitter'; import { NestExpressApplication } from '@nestjs/platform-express'; import { Test, TestingModule, TestingModuleBuilder } from '@nestjs/testing'; import { TypeOrmModule, TypeOrmModuleOptions } from '@nestjs/typeorm'; -import { RouterModule, Routes } from 'nest-router'; import { Connection, createConnection } from 'typeorm'; import { PrivateApiModule } from '../src/api/private/private-api.module'; @@ -240,7 +240,7 @@ export class TestSetupBuilder { 'https://md-' + testSetupBuilder.testId + '.example.com'; testSetupBuilder.testingModuleBuilder = Test.createTestingModule({ imports: [ - RouterModule.forRoutes(routes), + RouterModule.register(routes), TypeOrmModule.forRoot( TestSetupBuilder.getTestDBConf(testSetupBuilder.testId), ), diff --git a/yarn.lock b/yarn.lock index c895f65d4..08eb8cfeb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2339,7 +2339,6 @@ __metadata: minio: 7.1.1 mocked-env: 1.3.5 mysql: 2.18.1 - nest-router: 1.0.9 node-fetch: 2.6.11 passport: 0.6.0 passport-custom: 1.1.1 @@ -13975,13 +13974,6 @@ __metadata: languageName: node linkType: hard -"nest-router@npm:1.0.9": - version: 1.0.9 - resolution: "nest-router@npm:1.0.9" - checksum: 431d0b9e344f842f0eb759b07ab461d0f06e9733a806fdeb070004f041657d7e1e9ce270a32129a7b6ac2eda6f118fde3bea0b2e7211edb4d3aa67e02d0508e4 - languageName: node - linkType: hard - "next-tick@npm:1, next-tick@npm:^1.1.0": version: 1.1.0 resolution: "next-tick@npm:1.1.0"