refactor(core): Use Dependency Injection for all Controller classes (no-changelog) (#8146)
## Review / Merge checklist - [x] PR title and summary are descriptive
This commit is contained in:
committed by
GitHub
parent
518a99e528
commit
f69ddcd796
@@ -1,7 +1,10 @@
|
||||
import { Service } from 'typedi';
|
||||
import { CONTROLLER_BASE_PATH } from './constants';
|
||||
|
||||
export const RestController =
|
||||
(basePath: `/${string}` = '/'): ClassDecorator =>
|
||||
(target: object) => {
|
||||
Reflect.defineMetadata(CONTROLLER_BASE_PATH, basePath, target);
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
||||
return Service()(target);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user