I have this block of code, and the post works perfectly fine if i comment out the .then part, but if i leave it in, the post will not go through. How might I go about fixing this?
axios.post('http://localhost:5000/exercises/add', exercise)
.then(res => console.log(res.data))
.then(window.location.href = '/')
.catch(err => console.log(err))