fix: association block filter params (#3039)

This commit is contained in:
katherinehhh 2023-11-14 17:24:59 +08:00 committed by GitHub
parent 52c3f28c04
commit 3aca9e05d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -97,6 +97,9 @@ const useResource = (props: UseResourceProps) => {
if (record?.__parent?.[association?.sourceKey || 'id']) {
return api.resource(resource, record.__parent[association?.sourceKey || 'id']);
}
if (record?.[association?.sourceKey || 'id']) {
return api.resource(resource, record[association?.sourceKey || 'id']);
}
return api.resource(collection);
};