import {isNotEmpty} from "class-validator";
export Service {
create(createdto)
{
const {name,age} = createdto;
@isNotEmpty()
name //using decorator to check whether name is null or
undefined
}
}
Since, the decorator is only useful to class methods, I cannot use it inside method variables. How can it validate the method variables?