fix(client): cannot read properties of undefined (reading 'target')
This commit is contained in:
parent
947215f96d
commit
017c6f232d
@ -43,12 +43,17 @@ export const useCollectionManager = () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let cName = collectionName;
|
let cName = collectionName;
|
||||||
return fieldNames.reduce((result, curFieldName) => {
|
let collectionField;
|
||||||
const collectionField = getCollectionField(`${cName}.${curFieldName}`);
|
while (cName && fieldNames.length > 0) {
|
||||||
|
const fileName = fieldNames.shift();
|
||||||
|
collectionField = getCollectionField(`${cName}.${fileName}`);
|
||||||
|
if (collectionField?.target) {
|
||||||
cName = collectionField.target;
|
cName = collectionField.target;
|
||||||
|
} else {
|
||||||
|
cName = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
return collectionField;
|
return collectionField;
|
||||||
}, null);
|
|
||||||
},
|
},
|
||||||
getInterface(name: string) {
|
getInterface(name: string) {
|
||||||
return interfaces[name] ? clone(interfaces[name]) : null;
|
return interfaces[name] ? clone(interfaces[name]) : null;
|
||||||
|
Loading…
Reference in New Issue
Block a user