After the this newTask you are using a close bracket) use an open bracket (.
Sep 20, 2019
2
Level 8
Axios: Uncaught (in promise) TypeError: Cannot read property 'status' of undefined
Hello ,
When I use axios to create a model I have this error message ?
Uncaught (in promise) TypeError: Cannot read property 'status' of undefined
Here my code :
createTask() {
let newTask = this.$refs.addNewTaskData.newTask;
axios.post('/api/tasks',
newTask
)
.then((response) => {
//console.log(response.data);
this.$refs.closeAddModal.click();
this.taskCreatedConfirmation();
this.showTaskEdit(0);
this.$refs.dealTasksTable.refresh();
})
.catch(error => {
if (error.response.status === 422) {
this.$refs.addNewTaskData.errors = error.response.data.errors;
}
});
},
Please or to participate in this conversation.