diff --git a/src/Components/Note/Note.tsx b/src/Components/Note/Note.tsx index 376170a..4f670cc 100644 --- a/src/Components/Note/Note.tsx +++ b/src/Components/Note/Note.tsx @@ -20,7 +20,9 @@ export default function Note(props: props) { style={styles.button_remove} variant="contained" onClick={() => { - axios.delete("http://localhost:8000/notes/" + props.id + "/"); + axios.delete( + "http://localhost:8000/api/v1/notes/" + props.id + "/" + ); }} > Remove Note diff --git a/src/Components/NoteMapper/NoteMapper.tsx b/src/Components/NoteMapper/NoteMapper.tsx index e2ec199..6c8a6a2 100644 --- a/src/Components/NoteMapper/NoteMapper.tsx +++ b/src/Components/NoteMapper/NoteMapper.tsx @@ -10,17 +10,16 @@ export default function NoteMapper() { const navigate = useNavigate(); const [notes, setNotes] = useState([]); const [error, setError] = useState(false); - const [errormessage, seterrormessage] = useState(""); function server_get() { axios - .get("http://localhost:8000/notes/") + .get("http://localhost:8000/api/v1/notes/", { timeout: 50 }) .then((res) => { console.log("Server Response", res.data); + setError(false); setNotes(res.data); }) .catch((err) => { setError(true); - seterrormessage(err); }); } useEffect(() => { @@ -33,8 +32,7 @@ export default function NoteMapper() { if (error) { return (
404
-{errormessage}
+Error contacting Notes server