Files
Automata/packages/cli/src/decorators/RestController.ts
कारतोफ्फेलस्क्रिप्ट™ f69ddcd796 refactor(core): Use Dependency Injection for all Controller classes (no-changelog) (#8146)
## Review / Merge checklist
- [x] PR title and summary are descriptive
2023-12-27 11:50:43 +01:00

11 lines
355 B
TypeScript

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);
};