More refactoring
This commit is contained in:
parent
014f340c5b
commit
a45bed31d1
|
|
@ -579,7 +579,7 @@ function useStockItems({
|
|||
enabled: opened,
|
||||
queryKey: ['stockItems', filters],
|
||||
queryFn: async () => {
|
||||
if (items) {
|
||||
if (items !== undefined) {
|
||||
return Array.isArray(items) ? items : [items];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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) => {
|
||||
|
|
|
|||
|
|
@ -233,7 +233,6 @@ export default function BuildAllocatedStockTable({
|
|||
|
||||
return {
|
||||
items: stockItems,
|
||||
model: ModelType.stockitem,
|
||||
refresh: table.refreshTable
|
||||
};
|
||||
}, [table.selectedRecords, table.refreshTable]);
|
||||
|
|
|
|||
|
|
@ -513,7 +513,6 @@ export default function BuildOutputTable({
|
|||
const stockOperationProps: StockOperationProps = useMemo(() => {
|
||||
return {
|
||||
items: table.selectedRecords,
|
||||
model: ModelType.stockitem,
|
||||
refresh: table.refreshTable,
|
||||
filters: {}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -285,7 +285,6 @@ export default function SalesOrderAllocationTable({
|
|||
|
||||
return {
|
||||
items: stockItems,
|
||||
model: ModelType.stockitem,
|
||||
refresh: table.refreshTable
|
||||
};
|
||||
}, [table.selectedRecords, table.refreshTable]);
|
||||
|
|
|
|||
|
|
@ -403,7 +403,6 @@ export function StockItemTable({
|
|||
const stockOperationProps: StockOperationProps = useMemo(() => {
|
||||
return {
|
||||
items: table.selectedRecords,
|
||||
model: ModelType.stockitem,
|
||||
refresh: () => {
|
||||
table.clearSelectedRecords();
|
||||
table.refreshTable();
|
||||
|
|
|
|||
|
|
@ -224,7 +224,6 @@ export default function TransferOrderAllocationTable({
|
|||
|
||||
return {
|
||||
items: stockItems,
|
||||
model: ModelType.stockitem,
|
||||
refresh: table.refreshTable
|
||||
};
|
||||
}, [table.selectedRecords, table.refreshTable]);
|
||||
|
|
|
|||
Loading…
Reference in New Issue