diff --git a/client/src/app.js b/client/src/app.js index 1b355d8..4880a79 100644 --- a/client/src/app.js +++ b/client/src/app.js @@ -206,6 +206,12 @@ function App() { const moveItem = async (itemID, boxIDTarget) => { //post req console.log(`move item: ${itemID} to box ${boxIDTarget}`); + try { + const response = await axios.post(`${api.baseApiUrl}/item/${itemID}/${boxIDTarget}`); + } + catch(error) { + console.log(error); + } } const createItem = async (boxID, itemData) => { diff --git a/server/server.js b/server/server.js index a64132a..37d3680 100644 --- a/server/server.js +++ b/server/server.js @@ -113,9 +113,10 @@ app.delete('/box/:boxId/item/:itemId', async (request, response) => { }); //move item -app.post('/box/:boxIdSource/item/:itemId/to/:boxIdTarget', async (request, response) => { - const sourceBoxID = request.params.boxIdSource; +app.post('/box/item/:itemId/:boxIdTarget', async (request, response) => { + const itemID = request.params.itemId; const targetBoxID = request.params.boxIdTarget; + response.send({itemID,targetBoxID}); /*...*/ }) /*------------/CONTROLLER------------*/