fix: association block report error for toOne association field (#2582)

This commit is contained in:
katherinehhh 2023-09-01 18:54:27 +08:00 committed by GitHub
parent 797f566d70
commit e7d60389b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -345,6 +345,9 @@ export const useParamsFromRecord = () => {
const filterByTk = useFilterByTk();
const record = useRecord();
const { fields } = useCollection();
const fieldSchema = useFieldSchema();
const { getCollectionJoinField } = useCollectionManager();
const collectionField = getCollectionJoinField(fieldSchema?.['x-decorator-props']?.resource);
const filterFields = fields
.filter((v) => {
return ['boolean', 'date', 'integer', 'radio', 'sort', 'string', 'time', 'uid', 'uuid'].includes(v.type);
@ -360,7 +363,7 @@ export const useParamsFromRecord = () => {
const obj = {
filterByTk: filterByTk,
};
if (record.__collection) {
if (record.__collection && !['oho', 'm2o', 'obo'].includes(collectionField?.interface)) {
obj['targetCollection'] = record.__collection;
}
if (!filterByTk) {