-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
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
FIO-8037: fixed an issue where number component can be sent text thro… #70
FIO-8037: fixed an issue where number component can be sent text thro… #70
Conversation
|
||
// These are the validations that require a database connection. | ||
export const databaseRules: ValidationRuleInfo[] = [ | ||
validateUniqueInfo, | ||
validateCaptchaInfo | ||
validateCaptchaInfo, | ||
validateNumberInfo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
validateNumberInfo
should not be in databaseRules
. databaseRules
contain only rules, that interact with database and therefore should not be performed in vm. validateNumberInfo
should be placed in clientRules
export const validateNumberSync: RuleFnSync = (context: ValidationContext) => { | ||
const error = new FieldError('number', context); | ||
const { value } = context; | ||
if (!shouldValidate(context)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, remove this shouldValidate
call, as it's already done in validation processor validationRules
function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolve the merge conflicts please
…ent-text-through-API FIO-8037: fixed an issue where number component can be sent text thro…
…ugh API
Link to Jira Ticket
https://formio.atlassian.net/browse/FIO-8037
Description
Added validation to throw an error in case if a text value attempts to be submitted for number component.
Breaking Changes / Backwards Compatibility
n/a
Dependencies
n/a
How has this PR been tested?
Tested locally, added test for valid and invalid number value.
Checklist: