mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
fix: delete and bulk delete accounts.
fix: activate and inactivate accounts.
This commit is contained in:
@@ -109,14 +109,6 @@ function AccountsChart({
|
||||
intent: Intent.DANGER,
|
||||
});
|
||||
}
|
||||
if (errors.find(e => e.type === 'ACCOUNT.HAS.CHILD.ACCOUNTS')) {
|
||||
AppToaster.show({
|
||||
message: formatMessage({
|
||||
id: 'you_could_not_delete_account_has_child_accounts',
|
||||
}),
|
||||
intent: Intent.DANGER,
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
// Handle confirm account delete
|
||||
@@ -130,6 +122,7 @@ function AccountsChart({
|
||||
}),
|
||||
intent: Intent.SUCCESS,
|
||||
});
|
||||
queryCache.invalidateQueries('accounts-table');
|
||||
})
|
||||
.catch((errors) => {
|
||||
setDeleteAccount(false);
|
||||
@@ -215,6 +208,7 @@ function AccountsChart({
|
||||
}),
|
||||
intent: Intent.SUCCESS,
|
||||
});
|
||||
queryCache.invalidateQueries('accounts-table');
|
||||
})
|
||||
.catch((errors) => {
|
||||
setBulkDelete(false);
|
||||
@@ -288,6 +282,7 @@ function AccountsChart({
|
||||
}),
|
||||
intent: Intent.SUCCESS,
|
||||
});
|
||||
queryCache.invalidateQueries('accounts-table');
|
||||
})
|
||||
.catch((errors) => {
|
||||
setBulkActivate(false);
|
||||
@@ -318,6 +313,7 @@ function AccountsChart({
|
||||
}),
|
||||
intent: Intent.SUCCESS,
|
||||
});
|
||||
queryCache.invalidateQueries('accounts-table');
|
||||
})
|
||||
.catch((errors) => {
|
||||
setBulkInactiveAccounts(false);
|
||||
|
||||
@@ -192,10 +192,7 @@ function AccountsDataTable({
|
||||
[actionMenuList, formatMessage],
|
||||
);
|
||||
|
||||
const selectionColumn = useMemo(
|
||||
() => ({ minWidth: 40, width: 40, maxWidth: 40 }),
|
||||
[],
|
||||
);
|
||||
|
||||
|
||||
const handleDatatableFetchData = useCallback((...params) => {
|
||||
onFetchData && onFetchData(...params);
|
||||
@@ -216,14 +213,15 @@ function AccountsDataTable({
|
||||
columns={columns}
|
||||
data={accountsTable}
|
||||
onFetchData={handleDatatableFetchData}
|
||||
manualSortBy={true}
|
||||
selectionColumn={selectionColumn}
|
||||
selectionColumn={true}
|
||||
expandable={true}
|
||||
sticky={true}
|
||||
onSelectedRowsChange={handleSelectedRowsChange}
|
||||
loading={accountsLoading && !isMounted}
|
||||
rowContextMenu={rowContextMenu}
|
||||
expandColumnSpace={1}
|
||||
autoResetExpanded={false}
|
||||
selectionColumnWidth={50}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user