Skip to content
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

feat: add support for equalTo and proxy #78

Merged
merged 9 commits into from
Apr 11, 2024
Merged

feat: add support for equalTo and proxy #78

merged 9 commits into from
Apr 11, 2024

Conversation

simonguo
Copy link
Member

equalTo(fieldName: string, errorMessage?: string)

Check if the value is equal to the value of another field.

SchemaModel({
  password: StringType().isRequired(),
  confirmPassword: StringType().equalTo('password')
});

proxy(fieldNames: string[], options?: { checkIfValueExists?: boolean })

After the field verification passes, proxy verification of other fields.

  • fieldNames: The field name to be proxied.
  • options.checkIfValueExists: When the value of other fields exists, the verification is performed (default: false)
SchemaModel({
  password: StringType().isRequired().proxy(['confirmPassword']),
  confirmPassword: StringType().equalTo('password')
});

@simonguo simonguo merged commit d9f0e55 into master Apr 11, 2024
4 checks passed
@forispeti
Copy link

forispeti commented Apr 11, 2024

This change causes issues with rsuite's form. The schema model is updated here but not in the checking functions of the form(referring to Schema.ts line 13, spec to $spec)

@simonguo
Copy link
Member Author

This change causes issues with rsuite's form. The schema model is updated here but not in the checking functions of the form(referring to Schema.ts line 13, spec to $spec)

Thanks, rsuite will also be released after the update today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants