Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save onefriendaday/c36a43f491c8f91110ca32896c1cd1c0 to your computer and use it in GitHub Desktop.

Select an option

Save onefriendaday/c36a43f491c8f91110ca32896c1cd1c0 to your computer and use it in GitHub Desktop.
async asyncData({app, store}) {
let [article, authors] = await Promise.all([
app.$storyapi.get('cdn/stories/article', {
cv: store.state.cacheVersion
}),
app.$storyapi.get('cdn/stories', {
starts_with: 'authors/',
cv: store.state.cacheVersion
})
])
return {
article,
authors
}
}
computed: {
authors() {
return this.authors.data.stories.filter(() => {
return this.article.data.story.authors.indexOf(author.uuid) > -1
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment