Add unfollowing.
This commit is contained in:
parent
2088b3c4dd
commit
8f494b14f0
3 changed files with 23 additions and 1 deletions
|
@ -13,6 +13,9 @@
|
|||
<div class="followed">
|
||||
<span v-if="user.following">
|
||||
Following them!
|
||||
<button @click="unfollowUser">
|
||||
Unfollow!
|
||||
</button>
|
||||
</span>
|
||||
<span v-if="!user.following" >
|
||||
<button @click="followUser">
|
||||
|
@ -62,6 +65,11 @@
|
|||
const store = this.$store
|
||||
store.state.api.backendInteractor.followUser(this.user.id)
|
||||
.then((followedUser) => store.commit('addNewUsers', [followedUser]))
|
||||
},
|
||||
unfollowUser () {
|
||||
const store = this.$store
|
||||
store.state.api.backendInteractor.unfollowUser(this.user.id)
|
||||
.then((unfollowedUser) => store.commit('addNewUsers', [unfollowedUser]))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue