From 03a0ba57ffeb3fb653c1c6695ac5e4fe950e4622 Mon Sep 17 00:00:00 2001 From: sealday Date: Wed, 27 Mar 2024 17:59:58 +0800 Subject: [PATCH] fix: formula select pick wrong field --- package.json | 2 +- .../src/schema-component/antd/select/FormulaSelect.tsx | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b746b3aeb..abb86ba60 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,7 @@ "typescript": "5.1.3" }, "volta": { - "node": "20.9.0", + "node": "20.12.0", "yarn": "1.22.19" }, "dependencies": {} diff --git a/packages/core/client/src/schema-component/antd/select/FormulaSelect.tsx b/packages/core/client/src/schema-component/antd/select/FormulaSelect.tsx index 4b49e9d53..555966305 100644 --- a/packages/core/client/src/schema-component/antd/select/FormulaSelect.tsx +++ b/packages/core/client/src/schema-component/antd/select/FormulaSelect.tsx @@ -145,7 +145,10 @@ const replacePlaceholders = (inputStr, values) => { const useLabelOptions = (others) => { const fieldSchema = useFieldSchema(); const { getField } = useCollection_deprecated(); - const collectionField = useMemo(() => getField(fieldSchema.name), [fieldSchema.name]); + const collectionField = useMemo( + () => getField(fieldSchema['x-collection-field']), + [fieldSchema['x-collection-field']], + ); const request = { resource: collectionField?.target, action: 'list',