From adde5ce19c0f307d8bf9f0cc16de7400b6b0cb81 Mon Sep 17 00:00:00 2001 From: Zein Sleiman Date: Fri, 6 Dec 2024 09:34:34 -0600 Subject: [PATCH] fix: clean up fetchdata --- src/smart-components/role/RolesTable.tsx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/smart-components/role/RolesTable.tsx b/src/smart-components/role/RolesTable.tsx index 56dff9300..247686b08 100644 --- a/src/smart-components/role/RolesTable.tsx +++ b/src/smart-components/role/RolesTable.tsx @@ -83,9 +83,9 @@ const RolesTable: React.FunctionComponent = ({ selectedRole }) const { selected, onSelect, isSelected } = selection; const fetchData = useCallback( - (apiProps: { count: number; limit: number; offset: number; orderBy: string; filters: RoleFilters }) => { - const { count, limit, offset, orderBy, filters } = apiProps; - dispatch(fetchRolesWithPolicies({ ...mappedProps({ count, limit, offset, orderBy, filters }) })); + (apiProps: { limit: number; offset: number; orderBy: string; filters: RoleFilters }) => { + const { limit, offset, orderBy, filters } = apiProps; + dispatch(fetchRolesWithPolicies({ ...mappedProps({ limit, offset, orderBy, filters }) })); }, [dispatch] ); @@ -95,7 +95,6 @@ const RolesTable: React.FunctionComponent = ({ selectedRole }) limit: perPage, offset: (page - 1) * perPage, orderBy: `${direction === 'desc' ? '-' : ''}${sortBy}`, - count: totalCount || 0, filters: filters, }); }, [fetchData, page, perPage, sortBy, direction]); @@ -107,12 +106,10 @@ const RolesTable: React.FunctionComponent = ({ selectedRole }) limit: perPage, offset: (page - 1) * perPage, orderBy: `${direction === 'desc' ? '-' : ''}${sortBy}`, - count: totalCount || 0, filters: filters, }), 800 ); - return () => {}; }, [debouncedFetch, filters, onSetFilters]); const getSortParams = (columnIndex: number): ThProps['sort'] => ({