[Vuejs]-Not able to add user input into a rest api using store

0👍

In your store’s actions you’ve made a mistake, you’re trying to access to property info of this (that’s why it throw an error with undefined) :

let newuser= {
      userId:this.info.userId,
      id:this.info.id,
      title:this.info.title,
      body:this.info.body
 }

Need to be replaced by this:

let newuser = {
    userId: info.userId,
    id: info.id,
    title: info.title,
    body: info.body
}

Leave a comment