1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 07:49:41 +02:00

refactor(r2aform): remove validationData [EE-5559] (#9045)

* refactor(r2aform): remove validationData [EE-5559]

* update doc

---------

Co-authored-by: testa113 <testa113>
This commit is contained in:
Ali 2023-06-12 08:48:10 +12:00 committed by GitHub
parent 834ab7c158
commit 4a331b71e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 53 additions and 66 deletions

View file

@ -3,8 +3,7 @@ import { SchemaOf } from 'yup';
export async function validateForm<T>(
schemaBuilder: () => SchemaOf<T>,
formValues: T,
validationContext?: object
formValues: T
) {
const validationSchema = schemaBuilder();
@ -12,8 +11,6 @@ export async function validateForm<T>(
await validationSchema.validate(formValues, {
strict: true,
abortEarly: false,
// workaround to access all parents for nested fields. See clusterIpFormValidation for a use case.
context: { formValues, validationContext },
});
return undefined;
} catch (error) {