sequelize-typescript
sequelize-typescript copied to clipboard
add custom validation message to IsDate, isAlpha, Is ,.....
for example @IsDate(msg:"please enter a valid date")
@karimabdelhakim yeah, this would be useful and should be implemented. For now you can achieve this like so:
@Column({
...,
validate: {
isDate: {msg: 'your message'}
}
})
Any PRs are welcome :) ;)
Some update about this feature?
You can see this is implemented for some validators but not all of them: https://github.com/RobinBuschmann/sequelize-typescript/blob/master/src/validation/length.ts
You would basically just need to copy this to every validator in this folder, it wouldn't be a massive lift.