I'm trying to pass in a value to the URL param after the axios call it does not go through. code below explains my problem:
export function fetchUser(id) {
console.log(id) // works
return function(dispatch, id) {
console.log(id) // does not work
axios.get("https://jsonplaceholder.typicode.com/users?id=" + id)
.then((response) => {
dispatch({type: "FETCH_USER_FULFILLED", payload: response.data})
})
.catch((err) => {
dispatch({type: "FETCH_USER_REJECTED", payload: err})
})
}
}