From 7dbb096fc0970f4d5c5807794049e3eb359c2c13 Mon Sep 17 00:00:00 2001 From: Rizky Date: Wed, 26 Jun 2024 22:13:09 -0700 Subject: [PATCH] fix --- comps/form/field/type/TypeDropdown.tsx | 2 +- comps/form/gen/gen-form.ts | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/comps/form/field/type/TypeDropdown.tsx b/comps/form/field/type/TypeDropdown.tsx index e75337c..884a643 100755 --- a/comps/form/field/type/TypeDropdown.tsx +++ b/comps/form/field/type/TypeDropdown.tsx @@ -127,7 +127,7 @@ export const TypeDropdown: FC<{ selected: values, }); }} - allowNew={true} + allowNew={false} autoPopupWidth={true} focusOpen={true} mode={"multi"} diff --git a/comps/form/gen/gen-form.ts b/comps/form/gen/gen-form.ts index 79b5e82..d20aa2e 100755 --- a/comps/form/gen/gen-form.ts +++ b/comps/form/gen/gen-form.ts @@ -143,14 +143,18 @@ async ({ form, error, fm }: IForm) => { ) => { if (list.length) { const data = current.data.map((e) => { - return { + const record = { ...e, - m_role: { + ${table}: { connect: { ${pk}: form.${pk}, }, }, }; + + call_prasi_events("form", "before_save", [fm, record]); + + return record; }); await db._batch.upsert({ table: current.table,