More refactoring

This commit is contained in:
Oliver Walters 2026-06-28 07:51:05 +00:00
parent 014f340c5b
commit a45bed31d1
8 changed files with 2 additions and 9 deletions

View File

@ -579,7 +579,7 @@ function useStockItems({
enabled: opened, enabled: opened,
queryKey: ['stockItems', filters], queryKey: ['stockItems', filters],
queryFn: async () => { queryFn: async () => {
if (items) { if (items !== undefined) {
return Array.isArray(items) ? items : [items]; return Array.isArray(items) ? items : [items];
} }

View File

@ -1064,10 +1064,9 @@ export default function PartDetail() {
const stockOperationProps: StockOperationProps = useMemo(() => { const stockOperationProps: StockOperationProps = useMemo(() => {
return { return {
pk: part.pk,
model: ModelType.part,
refresh: refreshInstance, refresh: refreshInstance,
filters: { filters: {
part: part.pk,
in_stock: true in_stock: true
} }
}; };

View File

@ -797,7 +797,6 @@ export default function StockDetail() {
const stockOperationProps: StockOperationProps = useMemo(() => { const stockOperationProps: StockOperationProps = useMemo(() => {
return { return {
items: [stockitem], items: [stockitem],
model: ModelType.stockitem,
refresh: () => { refresh: () => {
const location = stockitem?.location; const location = stockitem?.location;
refreshInstancePromise().then((response) => { refreshInstancePromise().then((response) => {

View File

@ -233,7 +233,6 @@ export default function BuildAllocatedStockTable({
return { return {
items: stockItems, items: stockItems,
model: ModelType.stockitem,
refresh: table.refreshTable refresh: table.refreshTable
}; };
}, [table.selectedRecords, table.refreshTable]); }, [table.selectedRecords, table.refreshTable]);

View File

@ -513,7 +513,6 @@ export default function BuildOutputTable({
const stockOperationProps: StockOperationProps = useMemo(() => { const stockOperationProps: StockOperationProps = useMemo(() => {
return { return {
items: table.selectedRecords, items: table.selectedRecords,
model: ModelType.stockitem,
refresh: table.refreshTable, refresh: table.refreshTable,
filters: {} filters: {}
}; };

View File

@ -285,7 +285,6 @@ export default function SalesOrderAllocationTable({
return { return {
items: stockItems, items: stockItems,
model: ModelType.stockitem,
refresh: table.refreshTable refresh: table.refreshTable
}; };
}, [table.selectedRecords, table.refreshTable]); }, [table.selectedRecords, table.refreshTable]);

View File

@ -403,7 +403,6 @@ export function StockItemTable({
const stockOperationProps: StockOperationProps = useMemo(() => { const stockOperationProps: StockOperationProps = useMemo(() => {
return { return {
items: table.selectedRecords, items: table.selectedRecords,
model: ModelType.stockitem,
refresh: () => { refresh: () => {
table.clearSelectedRecords(); table.clearSelectedRecords();
table.refreshTable(); table.refreshTable();

View File

@ -224,7 +224,6 @@ export default function TransferOrderAllocationTable({
return { return {
items: stockItems, items: stockItems,
model: ModelType.stockitem,
refresh: table.refreshTable refresh: table.refreshTable
}; };
}, [table.selectedRecords, table.refreshTable]); }, [table.selectedRecords, table.refreshTable]);