Skip to content

Commit dc887ba

Browse files
authored
fix: update Controller without wrong constraints (#417)
1 parent a14ad54 commit dc887ba

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
### Changed
1313

1414
### Fixed
15+
- Fixed `Controller` without wrong constraints.
1516

1617
## [6.4.9]
1718

src/interfaces.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export interface MiddlewareMetaData {
2424
}
2525

2626
export type ControllerHandler = (...params: unknown[]) => unknown;
27-
export type Controller = Record<string, ControllerHandler>;
27+
export interface Controller {}
2828

2929
export interface ControllerMetadata {
3030
middleware: Middleware[];

src/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ export class InversifyExpressServer {
261261

262262
// invoke controller's action
263263
const value = await (
264-
httpContext.container.getNamed<Controller>(TYPE.Controller, controllerName)[
264+
httpContext.container.getNamed<Record<string, ControllerHandler>>(TYPE.Controller, controllerName)[
265265
key
266266
] as ControllerHandler
267267
)(...args);

0 commit comments

Comments
 (0)