From 72846fc80f12610bca50eb221238a91a07e44c6b Mon Sep 17 00:00:00 2001 From: luizakp Date: Tue, 19 Mar 2024 22:23:13 -0300 Subject: [PATCH] fix: sort on swr tables --- src/components/DataTable/SWRDataTable/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/DataTable/SWRDataTable/index.tsx b/src/components/DataTable/SWRDataTable/index.tsx index 2d32e1f..547275f 100644 --- a/src/components/DataTable/SWRDataTable/index.tsx +++ b/src/components/DataTable/SWRDataTable/index.tsx @@ -37,6 +37,7 @@ import { DataTableToolbar } from "#/components/DataTable/DataTableToolbar"; export function formatRequestParams(originalObj) { return { ...originalObj, + sorting: originalObj?.sorting?.length > 0 ? originalObj.sorting[0] : null, columnFilters: originalObj.columnFilters.reduce((acc, filter) => { acc[filter.id] = filter.value; return acc;