mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 14:20:31 +00:00
fix(WarehouseTransfer).
This commit is contained in:
@@ -65,10 +65,10 @@ export const useFetchItemWarehouseQuantity = () => {
|
||||
return isItemSuccess
|
||||
? {
|
||||
...tableRow,
|
||||
warehouses: [],
|
||||
warehouses: transformWarehousesQuantity(item),
|
||||
}
|
||||
: null;
|
||||
}, [isItemSuccess, tableRow]);
|
||||
}, [isItemSuccess, item, tableRow]);
|
||||
|
||||
// Reset the table row.
|
||||
const resetTableRow = React.useCallback(() => {
|
||||
@@ -84,3 +84,11 @@ export const useFetchItemWarehouseQuantity = () => {
|
||||
newRowMeta,
|
||||
};
|
||||
};
|
||||
|
||||
const transformWarehousesQuantity = (item) => {
|
||||
return item.item_warehouses.map((warehouse) => ({
|
||||
warehouseId: warehouse.warehouse_id,
|
||||
quantityOnHand: warehouse.quantity_on_hand,
|
||||
quantityOnHandFormatted: warehouse.quantity_on_hand_formatted,
|
||||
}));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user