diff --git a/client/src/app.js b/client/src/app.js index 001906c..47751b8 100644 --- a/client/src/app.js +++ b/client/src/app.js @@ -12,7 +12,7 @@ function App() { const [boxID, setBoxID] = useState(undefined); const [boxName, setBoxName] = useState(''); const [boxDescription, setBoxDescription] = useState(''); - + const [showModalBox, setShowModalBox] = useState(false); const [showModalItem, setShowModalItem] = useState(false); @@ -43,8 +43,8 @@ function App() { box.name.toLowerCase().includes(finalFilter) || box.description.toLowerCase().includes(finalFilter) || box.item.some(item => - (item.name && item.name.toLowerCase().includes(finalFilter)) || - (item.description && item.description.toLowerCase().includes(finalFilter)) + (item.name && item.name.toLowerCase().includes(finalFilter)) || + (item.description && item.description.toLowerCase().includes(finalFilter)) ) ) setFilteredData(filtered); @@ -94,7 +94,7 @@ function App() { const sortBox = async (target, source) => { try { - const response = await axios.put(`${api.baseApiUrl}/${source._id}/sort`,target); + const response = await axios.put(`${api.baseApiUrl}/${source._id}/sort`, target); setData(response.data); } catch (error) { @@ -167,10 +167,10 @@ function App() { const elements = [...event.currentTarget.parentElement.children]; const targetIndex = elements.indexOf(targetElement); const sourceIndex = elements.indexOf(sourceElement); - if(dragTarget._id !== dragSource._id) { + if (dragTarget._id !== dragSource._id) { - const target = Object.assign(dragTarget, {sort: targetIndex}); - const source = Object.assign(dragSource, {sort: sourceIndex}); + const target = Object.assign(dragTarget, { sort: targetIndex }); + const source = Object.assign(dragSource, { sort: sourceIndex }); await sortBox(target, source); } return false; @@ -295,7 +295,9 @@ function App() { const filterText = event.target.value; setFilter(filterText); } - + const handleClearFilter = () => { + setFilter(''); + } const boxForm =