mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-13 08:21:26 +00:00
Add useTable hook (#6000)
* Add new hook - useTable - Will replace useTableRefresh - More extensible (further functionality to follow) - Pass entire state through to final table - Defined interface for return type * Update BomTable * Update UsedInTable * Refactor attachment table * Update remaining tables * Clean StockItemTable * Fix NotificationTable * Remove unused import
This commit is contained in:
@ -5,7 +5,7 @@ import { useNavigate } from 'react-router-dom';
|
||||
|
||||
import { ApiPaths } from '../../../enums/ApiEndpoints';
|
||||
import { shortenString } from '../../../functions/tables';
|
||||
import { useTableRefresh } from '../../../hooks/TableRefresh';
|
||||
import { useTable } from '../../../hooks/UseTable';
|
||||
import { apiUrl } from '../../../states/ApiState';
|
||||
import { Thumbnail } from '../../images/Thumbnail';
|
||||
import { TableColumn } from '../Column';
|
||||
@ -265,14 +265,14 @@ export function PartListTable({ props }: { props: InvenTreeTableProps }) {
|
||||
const tableColumns = useMemo(() => partTableColumns(), []);
|
||||
const tableFilters = useMemo(() => partTableFilters(), []);
|
||||
|
||||
const { tableKey, refreshTable } = useTableRefresh('part');
|
||||
const table = useTable('part-list');
|
||||
|
||||
const navigate = useNavigate();
|
||||
|
||||
return (
|
||||
<InvenTreeTable
|
||||
url={apiUrl(ApiPaths.part_list)}
|
||||
tableKey={tableKey}
|
||||
tableState={table}
|
||||
columns={tableColumns}
|
||||
props={{
|
||||
...props,
|
||||
|
Reference in New Issue
Block a user