0๐
โ
You need to wrap post data in user
object
{
"user":
{
"email": "user@example.com",
"password": "password"
}
}
You can change your request
axios.post('http://localhost:3001/api/v1/users', {
user: {
email: this.email,
password: this.password
}
})
.then(res => (this.user = res.data))
.catch((error) => {
console.log(error)
});
Source:stackexchange.com