You should return the promise instead.
getNameById (id) {
return axios.get('/names/?ids=' + id)
.then(response => {
this.response = response.data
return this.response[0].name
})
}
and use it:
getNameById(someId)
.then(data => {
// here you can access the data
});