routing-controllers
Version:
Create structured, declarative and beautifully organized class-based controllers with heavy decorators usage for Express / Koa using TypeScript.
16 lines • 551 B
JavaScript
import { getMetadataArgsStorage } from '../index';
/**
* Used to set specific HTTP status code when result returned by a controller action is equal to undefined.
* Must be applied on a controller action.
*/
export function OnUndefined(codeOrError) {
return function (object, methodName) {
getMetadataArgsStorage().responseHandlers.push({
type: 'on-undefined',
target: object.constructor,
method: methodName,
value: codeOrError,
});
};
}
//# sourceMappingURL=OnUndefined.js.map