Skip to content

Commit

Permalink
fix: update Controller without wrong constraints (#417)
Browse files Browse the repository at this point in the history
  • Loading branch information
notaphplover authored Dec 10, 2024
1 parent a14ad54 commit dc887ba
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

### Fixed
- Fixed `Controller` without wrong constraints.

## [6.4.9]

Expand Down
2 changes: 1 addition & 1 deletion src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface MiddlewareMetaData {
}

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

export interface ControllerMetadata {
middleware: Middleware[];
Expand Down
2 changes: 1 addition & 1 deletion src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ export class InversifyExpressServer {

// invoke controller's action
const value = await (
httpContext.container.getNamed<Controller>(TYPE.Controller, controllerName)[
httpContext.container.getNamed<Record<string, ControllerHandler>>(TYPE.Controller, controllerName)[
key
] as ControllerHandler
)(...args);
Expand Down

0 comments on commit dc887ba

Please sign in to comment.