This is an automated email from the ASF dual-hosted git repository.
tiagobento pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-tools.git
The following commit(s) were added to refs/heads/main by this push:
new a6224358826 NO-ISSUE: In AJV v8 the `validation` object `dataPath`
property was renamed to `instancePath` (#2644)
a6224358826 is described below
commit a6224358826fba52e55255d8e1272fc05ffa1ee7
Author: Luiz João Motta <[email protected]>
AuthorDate: Fri Oct 4 14:13:45 2024 -0300
NO-ISSUE: In AJV v8 the `validation` object `dataPath` property was renamed
to `instancePath` (#2644)
---
packages/form/src/FormHook.tsx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/packages/form/src/FormHook.tsx b/packages/form/src/FormHook.tsx
index b69b160d9e7..e138033ba08 100644
--- a/packages/form/src/FormHook.tsx
+++ b/packages/form/src/FormHook.tsx
@@ -99,12 +99,12 @@ export function useForm<Input extends Record<string, any>,
Schema extends Record
(infos: any, detail: any) => {
if (detail.keyword === "type") {
// If it's a type error, it's handled by replacing the current
value with a undefined value.
- const formFieldPath = dataPathToFormFieldPath(detail.dataPath);
+ const formFieldPath = dataPathToFormFieldPath(detail.instancePath);
infos.changes = [...infos.changes, [formFieldPath, undefined]];
return infos;
} else if (detail.keyword === "enum") {
// A enum error is caused by a type error.
- const formFieldPath = dataPathToFormFieldPath(detail.dataPath);
+ const formFieldPath = dataPathToFormFieldPath(detail.instancePath);
infos.changes = [...infos.changes, [formFieldPath, undefined]];
return infos;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]