From 8f494b14f0917cabfa584e9a9b3b4521c598c7bb Mon Sep 17 00:00:00 2001
From: Roger Braun <roger@rogerbraun.net>
Date: Fri, 23 Dec 2016 16:45:57 +0100
Subject: Add unfollowing.

---
 src/components/user_card_content/user_card_content.vue | 8 ++++++++
 1 file changed, 8 insertions(+)

(limited to 'src/components/user_card_content/user_card_content.vue')

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]))
       }
     }
   }
-- 
cgit v1.2.3-70-g09d2

