From 627e2a9f4c4097475673118ec41113d0b1e4be2b Mon Sep 17 00:00:00 2001 From: chenos Date: Sat, 12 Mar 2022 00:38:11 +0800 Subject: [PATCH] fix: appends --- .../src/collection-manager/ResourceActionProvider.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/client/src/collection-manager/ResourceActionProvider.tsx b/packages/client/src/collection-manager/ResourceActionProvider.tsx index 18ab0d05d..5c590676b 100644 --- a/packages/client/src/collection-manager/ResourceActionProvider.tsx +++ b/packages/client/src/collection-manager/ResourceActionProvider.tsx @@ -28,6 +28,7 @@ const CollectionResourceActionProvider = (props) => { if (actionName === 'get') { others['filterByTk'] = record[collection.targetKey || collection.filterTargetKey || 'id']; } + const appends = request?.params?.appends || []; const service = useRequest( { ...request, @@ -36,7 +37,7 @@ const CollectionResourceActionProvider = (props) => { ...request?.params, appends: [ ...collection?.fields?.filter?.((field) => field.target).map((field) => field.name), - ...request?.params?.appends, + ...appends, ], sort: dragSort ? [collection.sortable === true ? 'sort' : collection.sortable] : request?.params?.sort, }, @@ -58,6 +59,7 @@ const AssociationResourceActionProvider = (props) => { const api = useAPIClient(); const record = useRecord(); const resourceOf = record[association.sourceKey]; + const appends = request?.params?.appends || []; const service = useRequest( { resourceOf, @@ -66,7 +68,7 @@ const AssociationResourceActionProvider = (props) => { ...request?.params, appends: [ ...collection?.fields?.filter?.((field) => field.target).map((field) => field.name), - ...request?.params?.appends, + ...appends, ], }, },