fix(plugin-workflow): fix null collection fields (#1674)

This commit is contained in:
Junyi 2023-04-08 14:20:33 +07:00 committed by GitHub
parent 93348c9ce6
commit e9d5fa7f9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -130,13 +130,14 @@ export function useWorkflowVariableOptions(types?) {
return options;
}
function useNormallizedFields(collection) {
function useNormallizedFields(collectionName) {
const compile = useCompile();
const { getCollection } = useCollectionManager();
const collection = getCollection(collectionName);
if (!collection) {
return [];
}
const { fields } = getCollection(collection);
const { fields } = collection;
const foreignKeyFields: any[] = [];
const otherFields: any[] = [];
fields.forEach(field => {