diff --git a/client/src/app.js b/client/src/app.js index 6a64466..b4af277 100644 --- a/client/src/app.js +++ b/client/src/app.js @@ -33,6 +33,7 @@ function App() { const [isMoving, setIsMoving] = useState(false); const [moveItemID, setMoveItemID] = useState(null); + const [moveItemBoxID, setMoveItemBoxID] = useState(null); //fetch all box data useEffect(() => { @@ -182,6 +183,7 @@ function App() { return false; } const handleSelectMoveBox = async (boxData, event) => { + setMoveItemBoxID(null); setMoveItemID(null); setIsMoving(false); await moveItem(moveItemID,boxData._id); @@ -272,6 +274,7 @@ function App() { setShowModalItem(true); } const handleMoveItem = (boxID, itemID) => { + setMoveItemBoxID(boxID); setMoveItemID(itemID); setIsMoving(true); /*highlight which boxes available to move to*/ @@ -396,7 +399,7 @@ function App() { {filteredData.map((box, index) => { return ( { const box = await getBox(boxID); response.send(box); }); - //move item app.post('/box/item/:itemId/:boxIdTarget', async (request, response) => { const itemID = request.params.itemId;