diff --git a/comps/form/gen/fields.ts b/comps/form/gen/fields.ts index 9b5f945..b66c920 100755 --- a/comps/form/gen/fields.ts +++ b/comps/form/gen/fields.ts @@ -42,7 +42,7 @@ export const newField = async ( name: field.name, label: formatName(field.name), type, - ext__required: field.optional ? "n" : "y", + ext__required: opt.is_from_table_edit || field.optional ? "n" : "y", sub_type: "number", child: { childs: [], @@ -308,7 +308,7 @@ return (React.createElement(React.Fragment, null, let sub_type = "typeahead"; if (field.relation?.fields.filter((e) => !e.is_pk)?.length >= 2) { - sub_type = "table-edit"; + sub_type = "table-edit"; child = createItem({ childs: await generateRelation( { diff --git a/comps/form/utils/init.tsx b/comps/form/utils/init.tsx index a7dcd46..a17b01e 100755 --- a/comps/form/utils/init.tsx +++ b/comps/form/utils/init.tsx @@ -176,7 +176,9 @@ export const formInit = (fm: FMLocal, props: FMProps) => { toast.dismiss(); if (!success) { - const count = Object.keys(fm.error.list).length; + const errors = Object.keys(fm.error.list); + const count = errors.length; + console.log(fm.error.list); toast.error(