[Vuejs]-Axios get request link error in url of a click event

0๐Ÿ‘

You are missing the slash in your axios request. It should be:

.get('/messages/getMessages/' + id)

0๐Ÿ‘

I checked and the code is working properly.

messages:function(id){
    var self = this;
    this.$http.get('/messages/getMessages/' + id)
        .then(response => { 
            console.log(response.data);
            this.privateMsgs = response.data;
        })
        .catch(function (error) {
            console.log(error.response);
        });
}

Leave a comment