We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have a numeric field with the "isNotEmpty" rule on it.
This numeric field is required. The value "0" is allowed in my use case (0 kg for example). Leaving the field empty is not allowed.
My problem is that "isNotEmpty" handles 0 as empty (as stated in the documentation) and triggers the error.
I do not know how to solve this problem, can someone please help me with this?
The text was updated successfully, but these errors were encountered:
I think that in your case isNotBlank would work better:
https://vestjs.dev/docs/enforce/enforce_rules#isnotblank
enforce(0).isNotBlank(); // passes
Sorry, something went wrong.
Thank you - that did the trick.
No branches or pull requests
I have a numeric field with the "isNotEmpty" rule on it.
This numeric field is required. The value "0" is allowed in my use case (0 kg for example).
Leaving the field empty is not allowed.
My problem is that "isNotEmpty" handles 0 as empty (as stated in the documentation) and triggers the error.
I do not know how to solve this problem, can someone please help me with this?
The text was updated successfully, but these errors were encountered: