Commit 105b8cef authored by nanahira's avatar nanahira

fix inject in controller

parent 4f2f4ede
Pipeline #6192 passed with stages
in 47 seconds
{ {
"name": "koishi-nestjs", "name": "koishi-nestjs",
"version": "1.1.0", "version": "1.1.1",
"description": "Koishi.js as Nest.js Module", "description": "Koishi.js as Nest.js Module",
"main": "dist/index.js", "main": "dist/index.js",
"typings": "dist/index.d.ts", "typings": "dist/index.d.ts",
......
...@@ -65,7 +65,6 @@ const koishiContextProvider: Provider<Context> = { ...@@ -65,7 +65,6 @@ const koishiContextProvider: Provider<Context> = {
koishiContextProvider, koishiContextProvider,
KoishiContextService, KoishiContextService,
KoishiInjectionService, KoishiInjectionService,
KoishiMiddleware,
], ],
exports: [KoishiService, koishiContextProvider], exports: [KoishiService, koishiContextProvider],
}) })
......
...@@ -16,8 +16,7 @@ export class KoishiInjectionService { ...@@ -16,8 +16,7 @@ export class KoishiInjectionService {
const token = const token =
typeof inquerier === 'string' ? inquerier : inquerier.constructor; typeof inquerier === 'string' ? inquerier : inquerier.constructor;
for (const module of this.moduleContainer.values()) { for (const module of this.moduleContainer.values()) {
const targetProvider = module.getProviderByKey(token); if (module.hasProvider(token) || module.controllers.has(token)) {
if (targetProvider) {
ctx = this.ctxService.getModuleCtx(ctx, module); ctx = this.ctxService.getModuleCtx(ctx, module);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment