fix(plugin-workflow): fix AssociationInput field path (#1542)

This commit is contained in:
Junyi 2023-03-06 17:45:09 +08:00 committed by GitHub
parent a463c3d747
commit 2e4354fcf3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,8 +13,8 @@ function AssociationInput(props) {
const { getCollectionFields } = useCollectionManager();
const { path } = useField();
const fieldName = path.segments[path.segments.length - 1] as string;
const { values: data } = useForm();
const fields = getCollectionFields(data?.config?.collection);
const { values: config } = useForm();
const fields = getCollectionFields(config?.collection);
const { type } = fields.find(item => item.name === fieldName);
const value = Array.isArray(props.value) ? props.value.join(',') : props.value;