mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 11:16:03 +00:00
fix: appends
This commit is contained in:
parent
db26c64aa2
commit
627e2a9f4c
@ -28,6 +28,7 @@ const CollectionResourceActionProvider = (props) => {
|
|||||||
if (actionName === 'get') {
|
if (actionName === 'get') {
|
||||||
others['filterByTk'] = record[collection.targetKey || collection.filterTargetKey || 'id'];
|
others['filterByTk'] = record[collection.targetKey || collection.filterTargetKey || 'id'];
|
||||||
}
|
}
|
||||||
|
const appends = request?.params?.appends || [];
|
||||||
const service = useRequest(
|
const service = useRequest(
|
||||||
{
|
{
|
||||||
...request,
|
...request,
|
||||||
@ -36,7 +37,7 @@ const CollectionResourceActionProvider = (props) => {
|
|||||||
...request?.params,
|
...request?.params,
|
||||||
appends: [
|
appends: [
|
||||||
...collection?.fields?.filter?.((field) => field.target).map((field) => field.name),
|
...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,
|
sort: dragSort ? [collection.sortable === true ? 'sort' : collection.sortable] : request?.params?.sort,
|
||||||
},
|
},
|
||||||
@ -58,6 +59,7 @@ const AssociationResourceActionProvider = (props) => {
|
|||||||
const api = useAPIClient();
|
const api = useAPIClient();
|
||||||
const record = useRecord();
|
const record = useRecord();
|
||||||
const resourceOf = record[association.sourceKey];
|
const resourceOf = record[association.sourceKey];
|
||||||
|
const appends = request?.params?.appends || [];
|
||||||
const service = useRequest(
|
const service = useRequest(
|
||||||
{
|
{
|
||||||
resourceOf,
|
resourceOf,
|
||||||
@ -66,7 +68,7 @@ const AssociationResourceActionProvider = (props) => {
|
|||||||
...request?.params,
|
...request?.params,
|
||||||
appends: [
|
appends: [
|
||||||
...collection?.fields?.filter?.((field) => field.target).map((field) => field.name),
|
...collection?.fields?.filter?.((field) => field.target).map((field) => field.name),
|
||||||
...request?.params?.appends,
|
...appends,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user