In my Vue application, I have a list of events that are displayed individually. When I visit the page of a selected event, an error message appears in my console:
GET http://localhost:1337/undefined 404 (Not Found)
. However, the image still loads correctly.
I tried setting the ID of the event to the component using this method:
export default {
data: function() {
return {
id: this.$route.params.id,
e: {},
users: []
}
},
methods: {
issueTicket: function(id, user) {
}
},
created(){
this.$http.get('http://localhost:1337/api/v1/event/find', { params : { id : this.id } }).then(result => {
this.e = result.body.result[0];
})
}
}
As I am new to Vue JS, is there a way to resolve this error and prevent it from occurring?