Problem when adding an object to an array in ES6 - this.listLogs.data [index] .push is not a function

0

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)
          })
    
asked by Oscar E. Alvarado 05.01.2018 в 21:56
source

0 answers