More refactoring
This commit is contained in:
parent
014f340c5b
commit
a45bed31d1
|
|
@ -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];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -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) => {
|
||||||
|
|
|
||||||
|
|
@ -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]);
|
||||||
|
|
|
||||||
|
|
@ -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: {}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -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]);
|
||||||
|
|
|
||||||
|
|
@ -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();
|
||||||
|
|
|
||||||
|
|
@ -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]);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue