From 11d127e3a42f8abdd2f538e69c5f6cb02e7a56ca Mon Sep 17 00:00:00 2001 From: katherinehhh Date: Thu, 13 Jul 2023 14:12:17 +0800 Subject: [PATCH] fix: no template data requested during depulicating (#2240) * fix: depulicate failed * fix: depulicate failed to load template data --- .../src/schema-initializer/components/DuplicateAction.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/core/client/src/schema-initializer/components/DuplicateAction.tsx b/packages/core/client/src/schema-initializer/components/DuplicateAction.tsx index 434690c74b..ab3825e8c6 100644 --- a/packages/core/client/src/schema-initializer/components/DuplicateAction.tsx +++ b/packages/core/client/src/schema-initializer/components/DuplicateAction.tsx @@ -41,16 +41,16 @@ export const DuplicateAction = observer((props: any) => { const { name } = useCollection(); const { getCollectionFields } = useCollectionManager(); const { t } = useTranslation(); - const collectionFields = getCollectionFields(__collection); + const collectionFields = getCollectionFields(__collection || name); const template = { key: 'duplicate', dataId: id, default: true, fields: duplicateFields?.filter((v) => { - return collectionFields.find((k) => k.name === v); + return collectionFields.find((k) => v.includes(k.name)); }) || [], - collection: __collection, + collection: __collection || name, }; const isLinkBtn = fieldSchema['x-component'] === 'Action.Link'; const handelQuickDuplicate = async () => {