I have a method to request a movie form an api. i use axios to get my request with an await before the the get and async before the method. i debbuged it, and it is at the const { data: results } = await axios.get(ui.movieName.baseUrl + ui.movieName.urlScoped) line. is my utilisation of async and await is needed? or i dont use promess right way?
async loadMovieName () {
const { data: movies } = await axios.get(baseUrl + urlMovie0)
this.movieName = movies.movies[0].name
}
>Solution :
Have you tried to put your request inside a try catch statement? For me, i never did an axios request without being in a try ctach. Also are you sure about your url is ok and have the right route to the api? Inside movies when you make the axios get, is movies.movies[0] is ok, it look sketchy imo. And last the ting i would think would be if get is the right method for your request.