You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can you give us some example of your use case, please?
I can see two paths to achieve that. The first is to redefine error messages globally, something like:
letvalidate=require('validate-fields')()validate.rewriteError('I was expecting a value greater than {}','Gimme more! At least {}')
Or something more granular, defined at the field level, but with a big drawback of changing syntax in some non-backwards compatible manner. Like:
letvalidate=require('validate-fields')()validate({a: {$type: 'uint(12)',$message: '{VALUE} is less than {1}. {PATH} demands change!'}},{a: 2})validate.lastError='2 is less than 12. a demands change!'
The second approach introduces a lot of space for future extensions.
So i wanted to have a custom error message than sticking to the defacto.
But it seems option 2 that you provided seems to be a perfect fix for me so i can define everything in my model.
There should be a way to set custom error messages that the default error message.
The text was updated successfully, but these errors were encountered: