diff options
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])) } } } |
