Hi there! I am currently in the process of registering a user through a POST
request.
I have implemented axios along with async/await for this task. However, I'm encountering an error that says register.then is not a function
. Can someone please provide assistance?
async sendUserData() {
try {
const register = await axios.post('/register', {
email: this.register.email.trim(),
password: this.register.password.trim(),
});
register.then(
response => {
console.log(response);
}
);
} catch (e) {
console.log(e);
}
}