fetch reblogged users

This commit is contained in:
Brenden Bice 2019-04-01 22:30:06 -04:00
parent 2d339cd3b8
commit 85457fc917
6 changed files with 50 additions and 1 deletions

View file

@ -122,6 +122,7 @@ const conversation = {
.then(({ancestors, descendants}) => {
const ancestorId = ancestors.length ? ancestors[0].id : this.status.id
this.fetchFavouritedByUsers(ancestorId)
this.fetchRebloggedByUsers(ancestorId)
this.$store.dispatch('addNewStatuses', { statuses: ancestors })
this.$store.dispatch('addNewStatuses', { statuses: descendants })
})
@ -160,6 +161,14 @@ const conversation = {
this.$store.dispatch('addFavoritedByUsers', { favoritedByUsers, id })
})
},
fetchRebloggedByUsers (id) {
this.$store.state.api.backendInteractor.fetchRebloggedByUsers({id: this.status.id}).then((response) => {
const rebloggedByUsers = response.map(item => ({
src: item.avatar_static,
name: item.display_name
}))
this.$store.dispatch('addRebloggedByUsers', { rebloggedByUsers, id })
})
}
}
}