Everythings works fine and i m also getting the data but i m getting this javascript error .
I have following network request
data: {
patient: null
}
methods: {
//call methods to add patients
setPatient(patient) {
this.patient = patient;
},
}
//network request in navigation guard
async beforeRouteEnter(to, from, next) {
await axios
.post(route("api.patient.ids"), { ids: [to.params.id] })
.then((res) => {
if (res.data.length) {
next((vm) => {
// console.log(typeof res.data[0]);
vm.setPatient(res.data[0]);
});
}
});
},
somebody could explain whats causing the problem ?
