I'm trying to learn Axios and Vue with using Twitch API. I'm fetching data from that API and there is thumbnail_url which is for channel's thumbnail photos but I have to change that data's width and height because it's coming like this;
https://static-cdn.jtvnw.net/previews-ttv/live_user_shroud-{width}x{height}.jpg
And I was trying to do like this;
beforeMount(){
helix.get('streams?language=en').then((response) => {
for(var i=0; i < response.data.data.length; i++){
response.data.data[i].thumbnail_url.replace("width", "40")
}
console.log(response.data.data)
this.results = response.data.data
})
.catch(function (error) {
console.log(error);
});
},
Actually, I didn't understand what that is not working. I know there is a point that I missed. If someone can help me, It'd be great. And If It is not correct way to do this, what is the correct way? Thanks a lot.