- Cannot have a blank accessor
This commit is contained in:
parent
fd7d0bda0f
commit
228577c871
|
|
@ -114,9 +114,10 @@ export type StockColumnProps = TableColumnProps & {
|
|||
// Render a StockItem instance within a table
|
||||
export function StockColumn(props: StockColumnProps): TableColumn {
|
||||
return {
|
||||
accessor: props.accessor ?? 'stock_item',
|
||||
title: t`Stock Item`,
|
||||
...props,
|
||||
ordering: props.ordering || 'stock',
|
||||
accessor: props.accessor || 'stock',
|
||||
render: (record: any) => {
|
||||
const stock_item =
|
||||
resolveItem(record, props.accessor ?? 'stock_item_detail') ?? {};
|
||||
|
|
|
|||
|
|
@ -486,6 +486,10 @@ export function InvenTreeTable<T extends Record<string, any>>({
|
|||
tableState.setPage(1);
|
||||
setSortStatus(status);
|
||||
|
||||
if (!status.columnAccessor) {
|
||||
console.error('Invalid column accessor provided for table sorting');
|
||||
}
|
||||
|
||||
setTableSorting(cacheKey)(status);
|
||||
},
|
||||
[cacheKey]
|
||||
|
|
|
|||
Loading…
Reference in New Issue