fix(e2e): should use getPrimaryKey to get primaryKey

This commit is contained in:
Zeke Zhang 2024-02-06 21:05:05 +08:00
parent f02f8dc845
commit 35b4bfeab6

View File

@ -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() },
};
}),
);