@eddaic/nestjs-decorators
Version:
Additional decorators intended for use with NestJS framework.
22 lines (21 loc) • 714 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApiPropertyDate = ApiPropertyDate;
exports.ApiPropertyDateOptional = ApiPropertyDateOptional;
const api_property_decorator_1 = require("@nestjs/swagger/dist/decorators/api-property.decorator");
function ApiPropertyDate(options) {
return (0, api_property_decorator_1.createApiPropertyDecorator)({
...options,
type: 'string',
format: 'date-time',
required: true,
});
}
function ApiPropertyDateOptional(options) {
return (0, api_property_decorator_1.createApiPropertyDecorator)({
...options,
type: 'string',
format: 'date-time',
required: false,
});
}