diff --git a/client/src/components/History.js b/client/src/components/History.js index 26d93fb..436611c 100644 --- a/client/src/components/History.js +++ b/client/src/components/History.js @@ -132,13 +132,16 @@ const History = () => { const [edit, setEdit] = useState(false); const [deleted, setDeleted] = useState(); - useEffect(async () => { - await fetch(`${process.env.REACT_APP_BASE_URL}/history`) - .then((res) => res.json()) - .then((data) => { - setHistory(data); - setLoading(false); - }); + useEffect(() => { + async function fetchData() { + fetch(`${process.env.REACT_APP_BASE_URL}/history`) + .then((res) => res.json()) + .then((data) => { + setHistory(data); + setLoading(false); + }); + } + fetchData(); }, [prediction, deleted]); const handleUpdate = (image_id, image_prediction) => { diff --git a/client/src/components/Layout.js b/client/src/components/Layout.js index 21cd0b0..cc838ef 100644 --- a/client/src/components/Layout.js +++ b/client/src/components/Layout.js @@ -7,6 +7,7 @@ import Home from "./Home"; const Layout = () => { const { component } = useParams(); + console.log("component", component); return (