From 35b4bfeab69a7caac1e618855c4f3391dd10e54b Mon Sep 17 00:00:00 2001 From: Zeke Zhang <958414905@qq.com> Date: Tue, 6 Feb 2024 21:05:05 +0800 Subject: [PATCH] fix(e2e): should use getPrimaryKey to get primaryKey --- .../src/schema-component/antd/association-field/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/core/client/src/schema-component/antd/association-field/index.ts b/packages/core/client/src/schema-component/antd/association-field/index.ts index 8a0aa1dd37..813c3d3d41 100644 --- a/packages/core/client/src/schema-component/antd/association-field/index.ts +++ b/packages/core/client/src/schema-component/antd/association-field/index.ts @@ -1,11 +1,11 @@ -import { connect, mapReadPretty, mapProps, useFieldSchema } from '@formily/react'; +import { connect, mapProps, mapReadPretty, useFieldSchema } from '@formily/react'; +import { useCollection, useCollectionManager } from '../../../collection-manager'; import { Action } from '../action'; import { Editable } from './Editable'; import { InternalPicker } from './InternalPicker'; import { Nester } from './Nester'; import { ReadPretty } from './ReadPretty'; import { SubTable } from './SubTable'; -import { useCollectionManager, useCollection } from '../../../collection-manager'; export const AssociationField: any = connect( Editable, @@ -18,7 +18,7 @@ export const AssociationField: any = connect( const targetCollection = getCollection(collectionField?.target); return { ...props, - fieldNames: { ...props.fieldNames, value: collectionField?.targetKey || targetCollection.primaryKey }, + fieldNames: { ...props.fieldNames, value: collectionField?.targetKey || targetCollection.getPrimaryKey() }, }; }), );