From 57bc1d7d3f31bfab703d4af67146238472dc66ad Mon Sep 17 00:00:00 2001 From: katherinehhh Date: Mon, 8 May 2023 19:59:35 +0800 Subject: [PATCH] fix: nester appends --- .../client/src/block-provider/FormBlockProvider.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/core/client/src/block-provider/FormBlockProvider.tsx b/packages/core/client/src/block-provider/FormBlockProvider.tsx index 87f548103c..92f7af6d93 100644 --- a/packages/core/client/src/block-provider/FormBlockProvider.tsx +++ b/packages/core/client/src/block-provider/FormBlockProvider.tsx @@ -67,7 +67,10 @@ export const useIsEmptyRecord = () => { const getAssociationAppends = (schema, arr = []) => { return schema.reduceProperties((buf, s) => { - if (s['x-component'] === 'CollectionField' && ['object', 'array'].includes(s.type)) { + if ( + s['x-component'] === 'CollectionField' && + (['object', 'array'].includes(s.type) || ['createdBy', 'updatedBy'].includes(s.name)) + ) { buf.push(s.name); if (s['x-component-props'].mode === 'Nester') { return getAssociationAppends(s, buf); @@ -143,12 +146,7 @@ const useAssociationNames = (collection) => { }, data); const associations = data.filter((g) => g.length); const appends = flattenNestedList(associations); - const updateAssociationValues = associations.concat().map((k) => { - return k.map((v, index) => { - const s = index > 0 ? k.slice(0, index + 1) : [v]; - return s.join('.'); - }); - }); + console.log(appends, associations); return { appends, updateAssociationValues: appends }; }; export const FormBlockProvider = (props) => {