[Vuejs]-VueJS Promise is failing

0👍

You don’t have to recreate a new promise object. You can just return the object you want to be passed to the next call.

getProducts: function() {
    let url = config.API.GetProduct

    return this.$http.get(url).then(response => {
        this.products = response.data.resource;
        return this.products.map(this.getOwner);
    }, error=> {
        console.error("An error happened!")
    });
},

Leave a comment