1๐
โ
I guess there is an error in your axios call. You are sending token
as the payload / body of the request instead of the id. And you send the id as a part of the options object. See axios docs.
Change it to:
axios
.put(`http://localhost:5000/api/addresses/set/default`, { id },{ headers: {
Authorization: "Bearer" + token,
"x-access-token": token
}
})
.then (โฆ)
Source:stackexchange.com