@tsed/schema
Version:
JsonSchema module for Ts.ED Framework
20 lines (19 loc) • 493 B
JavaScript
import { Store } from "@tsed/core";
import { JsonEntityFn } from "../common/jsonEntityFn.js";
/**
* Add Children class to compose routes
*
* @decorator
* @swagger
* @schema
* @classDecorator
* @param children
*/
export function Children(...children) {
return JsonEntityFn((store) => {
store.store.set("childrenControllers", children);
children.forEach((childToken) => {
Store.from(childToken).set("parentController", store.token);
});
});
}