Attachments in the story detail page

This commit is contained in:
Adam Coldrick 2020-05-04 19:24:40 +01:00
parent 200a77df28
commit 058df2b6a6

View File

@ -32,6 +32,13 @@
<span v-if="!story.tags.length">This story has no tags yet.</span>
<span class="tag" v-for="tag in story.tags" :key="tag">{{ tag }}</span>
</div>
<div class="card">
<h2>Attachments</h2>
<span v-if="!attachments.length">This story has no attachments yet.</span>
<p v-for="attachment in attachments" :key="attachment">
{{ attachment.name }}
</p>
</div>
</div>
</div>
<h2>Events Timeline and Comments</h2>
@ -54,6 +61,7 @@ export default {
},
data () {
return {
attachments: [],
creator: {},
events: [],
story: {},
@ -73,6 +81,9 @@ export default {
this.creator = creator
const { data: tasks } = await axios.get(`${baseUrl}/stories/${storyId}/tasks`)
this.tasks = tasks
// TODO: Account for the fact that attachment support can be disabled on the API side
const { data: attachments } = await axios.get(`${baseUrl}/stories/${storyId}/attachments`)
this.attachments = attachments
const requests = []
tasks.reduce((acc, task) => {