I want to update status, but when I want to do the 'put' it's not working cause axios in axios.put is not define. Can you help me please.
getAbsencesByRequestId(reqId) {
axios.get(REQUESTID_URL + reqId).then(response => {
this.collaboId = response.data[0].collabId;
this.beginDate = response.data[0].startDate;
this.finishDate = response.data[0].endDate;
this.reason = response.data[0].type;
}, (error) => {
console.log(error.response.status)
}) axios.put(REQUEST_URL + reqId, {
collabId: this.collaboId,
startDate: this.beginDate,
endDate: this.finishDate,
status: 'VALIDATED',
type: this.reason
})
},
You should manage properly the order of your requests
axios.get(url /*optional payload and headers*/).then((getResponse) => {
//do GET stuff with response
}).then(() => {
//do PUT call
axios.put(url, /*optional payload and headers*/).then((putResponse) => {
//do PUT stuff with response
})
}).catch((e) => {
//handle the error
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With