Created
July 5, 2018 08:53
-
-
Save onefriendaday/c36a43f491c8f91110ca32896c1cd1c0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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