From c42a2040e240ccd651971a2b02d2f709934c6a6a Mon Sep 17 00:00:00 2001 From: chenos Date: Sat, 10 Aug 2024 09:03:14 +0800 Subject: [PATCH] fix(client): missing sort parameter (#5034) --- .../blocks/data-blocks/table/hooks/useTableBlockProps.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/core/client/src/modules/blocks/data-blocks/table/hooks/useTableBlockProps.tsx b/packages/core/client/src/modules/blocks/data-blocks/table/hooks/useTableBlockProps.tsx index 747a4066e2..59c9af11ea 100644 --- a/packages/core/client/src/modules/blocks/data-blocks/table/hooks/useTableBlockProps.tsx +++ b/packages/core/client/src/modules/blocks/data-blocks/table/hooks/useTableBlockProps.tsx @@ -86,7 +86,11 @@ export const useTableBlockProps = () => { : globalSort || ctx.dragSortBy : ctx.dragSortBy; const currentPageSize = pageSize || fieldSchema.parent?.['x-decorator-props']?.['params']?.pageSize; - ctx.service.run({ ...params?.[0], page: current || 1, pageSize: currentPageSize, sort }); + const args = { ...params?.[0], page: current || 1, pageSize: currentPageSize }; + if (sort) { + args['sort'] = sort; + } + ctx.service.run(args); }, [globalSort, params], ),