Skip to content

Commit

Permalink
refactor: use the inventory stock location when creating a new invent…
Browse files Browse the repository at this point in the history
…ory line
  • Loading branch information
vhu-axelor committed Feb 12, 2025
1 parent 98ce4aa commit a451680
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ const InventoryLineDetailsScreen = ({route, navigation}) => {
[_inventoryLine, inventoryLineId],
);

console.log('inventory: ', inventory);

const [loading, setLoading] = useState(true);
const [rack, setRack] = useState(null);
const [realQty, setRealQty] = useState(0);
Expand All @@ -88,9 +90,9 @@ const InventoryLineDetailsScreen = ({route, navigation}) => {
useEffect(() => {
setRealQty(inventoryLine?.realQty ?? 0);
setDescription(inventoryLine?.description);
setStockLocation(inventoryLine?.stockLocation);
setStockLocation(inventoryLine?.stockLocation ?? inventory.stockLocation);
setLoading(false);
}, [inventoryLine]);
}, [inventory, inventoryLine]);

useEffect(() => {
if (productFromId?.id !== productId) {
Expand Down

0 comments on commit a451680

Please sign in to comment.