From 3aca9e05d9aa0d3a007a3e495e8957c2b6f16915 Mon Sep 17 00:00:00 2001 From: katherinehhh Date: Tue, 14 Nov 2023 17:24:59 +0800 Subject: [PATCH] fix: association block filter params (#3039) --- packages/core/client/src/block-provider/BlockProvider.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/core/client/src/block-provider/BlockProvider.tsx b/packages/core/client/src/block-provider/BlockProvider.tsx index 3860f43a0..5dcc14628 100644 --- a/packages/core/client/src/block-provider/BlockProvider.tsx +++ b/packages/core/client/src/block-provider/BlockProvider.tsx @@ -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); };