mirror of
https://github.com/bknd-io/bknd/
synced 2026-08-03 08:36:01 +00:00
added validator for rjsf, hook form via standard schema
This commit is contained in:
@@ -22,6 +22,7 @@ import { useRoutePathState } from "ui/hooks/use-route-path-state";
|
||||
import { MantineSelect } from "ui/components/form/hook-form-mantine/MantineSelect";
|
||||
import type { TPrimaryFieldFormat } from "data/fields/PrimaryField";
|
||||
import { s, stringIdentifier } from "core/object/schema";
|
||||
import { standardSchemaResolver } from "@hookform/resolvers/standard-schema";
|
||||
|
||||
const fieldsSchemaObject = originalFieldsSchemaObject;
|
||||
const fieldsSchema = s.anyOf(Object.values(fieldsSchemaObject));
|
||||
@@ -88,8 +89,7 @@ export const EntityFieldsForm = forwardRef<EntityFieldsFormRef, EntityFieldsForm
|
||||
reset,
|
||||
} = useForm({
|
||||
mode: "all",
|
||||
// @todo: add resolver
|
||||
//resolver: typeboxResolver(schema),
|
||||
resolver: standardSchemaResolver(schema),
|
||||
defaultValues: {
|
||||
fields: entityFields,
|
||||
} as TFieldsFormSchema,
|
||||
|
||||
Reference in New Issue
Block a user