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,
queryKey: ['stockItems', filters],
queryFn: async () => {
if (items) {
if (items !== undefined) {
return Array.isArray(items) ? items : [items];
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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