routing-controllers
Version:
Create structured, declarative and beautifully organized class-based controllers with heavy decorators usage for Express / Koa using TypeScript.
19 lines • 625 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.OnNull = OnNull;
const index_1 = require("../index");
/**
* Used to set specific HTTP status code when result returned by a controller action is equal to null.
* Must be applied on a controller action.
*/
function OnNull(codeOrError) {
return function (object, methodName) {
(0, index_1.getMetadataArgsStorage)().responseHandlers.push({
type: 'on-null',
target: object.constructor,
method: methodName,
value: codeOrError,
});
};
}
//# sourceMappingURL=OnNull.js.map
;