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; return options;
} }
function useNormallizedFields(collection) { function useNormallizedFields(collectionName) {
const compile = useCompile(); const compile = useCompile();
const { getCollection } = useCollectionManager(); const { getCollection } = useCollectionManager();
const collection = getCollection(collectionName);
if (!collection) { if (!collection) {
return []; return [];
} }
const { fields } = getCollection(collection); const { fields } = collection;
const foreignKeyFields: any[] = []; const foreignKeyFields: any[] = [];
const otherFields: any[] = []; const otherFields: any[] = [];
fields.forEach(field => { fields.forEach(field => {