fix field

This commit is contained in:
rizky 2024-07-30 20:06:14 -07:00
parent dcc7a39a37
commit b2b34659c6
3 changed files with 24 additions and 19 deletions

View File

@ -101,7 +101,7 @@ export const newField = async (
type: "date",
ext__show_label: show ? "y" : "n",
ext__required: field.optional ? "n" : "y",
sub_type: "datetime",
sub_type: "date",
child: {
childs: [],
},

View File

@ -12,6 +12,7 @@ export const generateField = async (
commit: boolean
) => {
let fieldType = getString(data.sub_type.value) as string;
let table = getString(data.rel__gen_table.value) as string;
const raw_fields = JSON.parse(data.rel__gen_fields.value) as (
| string

View File

@ -54,6 +54,9 @@ export const formInit = (fm: FMLocal, props: FMProps) => {
}
}
if (should_load) {
if (!on_load) {
console.error("Form on_load is empty. Please re-generate the form.");
} else {
const on_load_result = on_load({ fm });
let result = undefined;
if (
@ -79,6 +82,7 @@ export const formInit = (fm: FMLocal, props: FMProps) => {
}
}
}
}
fm.internal.reload.done.map((e) => e());
setTimeout(() => {