Hey, in nuxt guide there is example how to deal with dynamic routes using promise and call to axios, now, how to deal with two of them?
generate: {
routes: function (callback) {
let posts = axios.get('https://api.com/posts', {params: {size: 10}}).then((res) => {
return res.data.posts.map((post) => {
return '/feed/' + post.id
})
})
let users = axios.get('https://api.com/users', {params: {size: 10}}).then((res) => {
return res.data.users.map((user) => {
return '/user/' + user.id
})
})
let route = Promise.all([posts, users]).then(values => {
return callback(null, route)
})
}
},This is my example - trying to connect two promises but still have error.
<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c884">#c884</a>)</em></sub></div>