mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
feat: optimize chart of accounts.
This commit is contained in:
@@ -28,6 +28,7 @@ function AccountsChart({
|
||||
fetchResourceFields,
|
||||
getResourceFields,
|
||||
requestFetchAccountsTable,
|
||||
addAccountsTableQueries
|
||||
}) {
|
||||
const [state, setState] = useState({
|
||||
deleteAlertActive: false,
|
||||
@@ -116,9 +117,21 @@ function AccountsChart({
|
||||
console.log(accounts);
|
||||
};
|
||||
|
||||
const handleFilterChanged = useCallback(() => { fetchAccountsHook.execute(); }, []);
|
||||
const handleFilterChanged = useCallback(() => {
|
||||
|
||||
fetchAccountsHook.execute();
|
||||
}, [fetchAccountsHook]);
|
||||
|
||||
const handleViewChanged = useCallback(() => { fetchAccountsHook.execute(); }, []);
|
||||
const handleFetchData = useCallback(() => { fetchAccountsHook.execute(); }, []);
|
||||
const handleFetchData = useCallback(({ pageIndex, pageSize, sortBy }) => {
|
||||
addAccountsTableQueries({
|
||||
...(sortBy.length > 0) ? {
|
||||
column_sort_by: sortBy[0].id,
|
||||
sort_by: sortBy[0].desc ? 'desc' : 'asc',
|
||||
} : {},
|
||||
});
|
||||
fetchAccountsHook.execute();
|
||||
}, [fetchAccountsHook, addAccountsTableQueries]);
|
||||
|
||||
return (
|
||||
<DashboardInsider loading={fetchHook.pending} name={'accounts-chart'}>
|
||||
|
||||
Reference in New Issue
Block a user