wip gen form

This commit is contained in:
rizky 2024-07-30 19:02:21 -07:00
parent 9590e14ff8
commit dcc7a39a37
1 changed files with 53 additions and 49 deletions

View File

@ -147,6 +147,7 @@ export const generateForm = async (
walkGenForm(new_body, existing_childs as any); walkGenForm(new_body, existing_childs as any);
} }
if (item.edit) {
const current_body = propFromItem(item)?.body?.value as IItem; const current_body = propFromItem(item)?.body?.value as IItem;
if (current_body) { if (current_body) {
@ -194,7 +195,8 @@ export const generateForm = async (
if ( if (
mapping["32550d01-42a3-4b15-a04a-2c2d5c3c8e67"] && mapping["32550d01-42a3-4b15-a04a-2c2d5c3c8e67"] &&
Object.keys(mapping["32550d01-42a3-4b15-a04a-2c2d5c3c8e67"]).length > 0 Object.keys(mapping["32550d01-42a3-4b15-a04a-2c2d5c3c8e67"]).length >
0
) { ) {
for (const val of Object.values( for (const val of Object.values(
mapping["32550d01-42a3-4b15-a04a-2c2d5c3c8e67"] mapping["32550d01-42a3-4b15-a04a-2c2d5c3c8e67"]
@ -207,7 +209,9 @@ export const generateForm = async (
new_body = current_body; new_body = current_body;
} }
} }
}
console.log(result);
if (commit) { if (commit) {
Object.keys(result).map((e) => { Object.keys(result).map((e) => {
item.edit.setProp(e, result[e]); item.edit.setProp(e, result[e]);