From b4058ecb1b1fe8ded0c784afc349657cafd1a995 Mon Sep 17 00:00:00 2001 From: katherinehhh Date: Tue, 12 Mar 2024 21:29:47 +0800 Subject: [PATCH] fix: incorrect pagination query parameters when batch deleting last page (#3670) --- packages/core/client/src/block-provider/hooks/index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/core/client/src/block-provider/hooks/index.ts b/packages/core/client/src/block-provider/hooks/index.ts index abcdcc27c..1a7efc58c 100644 --- a/packages/core/client/src/block-provider/hooks/index.ts +++ b/packages/core/client/src/block-provider/hooks/index.ts @@ -986,6 +986,11 @@ export const useBulkDestroyActionProps = () => { filterByTk: field.data?.selectedRowKeys, }); field.data.selectedRowKeys = []; + const currentPage = service.params[0]?.page; + const totalPage = service.data?.meta?.totalPage; + if (currentPage === totalPage) { + service.params[0].page = currentPage - 1; + } service?.refresh?.(); }, };