diff options
| author | Roger Braun <roger@rogerbraun.net> | 2016-12-23 16:45:57 +0100 |
|---|---|---|
| committer | Roger Braun <roger@rogerbraun.net> | 2016-12-23 16:45:57 +0100 |
| commit | 8f494b14f0917cabfa584e9a9b3b4521c598c7bb (patch) | |
| tree | 4f30e927e361ec30868a5c734543fd3126abd697 /src/components/user_card_content/user_card_content.vue | |
| parent | 2088b3c4dd39aa8d8b516108130d0ac0a9fd855e (diff) | |
Add unfollowing.
Diffstat (limited to 'src/components/user_card_content/user_card_content.vue')
| -rw-r--r-- | src/components/user_card_content/user_card_content.vue | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/components/user_card_content/user_card_content.vue b/src/components/user_card_content/user_card_content.vue index 18a582e7..d9e661a9 100644 --- a/src/components/user_card_content/user_card_content.vue +++ b/src/components/user_card_content/user_card_content.vue @@ -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])) } } } |
