'bad api request in vuejs with axios?
I have a method to request a movie form an API. I have used axios to get my request with an await before the get and async before the method. I debugged it, and it is at the const { data: results } = await axios.get(ui.movieName.baseUrl + ui.movieName.urlScoped) line. Is my utilization of async and await is needed ? or I don;t use promises right way?
async loadMovieName () {
const { data: movies } = await axios.get(baseUrl + urlMovie0)
this.movieName = movies.movies[0].name
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
