Good morning, I am trying to add an object to an array, I leave the code for a better reference. The problem is that I get an error that the push function is not correct. Maybe I'm doing something in a bad way. Please your help or some clue how to do this.
HTTP.post('getLogs', this.params).then(response => {
this.listLogs = response.data
this.listLogs.pages = parseInt(response.data.pages)
return this.listLogs
})
.then(response => {
for (const [index, log] of response.data.entries()) {
const traceSender = {'idMail': log.id, 'currentPage': '1', 'registersInPage': '10'}
// console.log(log.id)
HTTP.post('getTraceSender', traceSender).then(response => {
console.log(this.listLogs.data)
this.listLogs.data[index].push({'senderTrace': response.data})
})
}
})
.catch(e => {
this.errors.push(e)
console.log(this.errors)
})