]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+admin/follows/shared/follow.service.ts
Add ability to unfollow a server
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / follows / shared / follow.service.ts
index f66ed477df662d10fbc68e990c5c8b3148c68ad8..0bfbe8eb60e4437297dd400a87ab0a2a9f9c9fe5 100644 (file)
@@ -37,7 +37,7 @@ export class FollowService {
       .catch(res => this.restExtractor.handleError(res))
   }
 
-  follow (notEmptyHosts: String[]) {
+  follow (notEmptyHosts: string[]) {
     const body = {
       hosts: notEmptyHosts
     }
@@ -46,4 +46,10 @@ export class FollowService {
                         .map(this.restExtractor.extractDataBool)
                         .catch(res => this.restExtractor.handleError(res))
   }
+
+  unfollow (follow: AccountFollow) {
+    return this.authHttp.delete(FollowService.BASE_APPLICATION_URL + '/following/' + follow.following.id)
+      .map(this.restExtractor.extractDataBool)
+      .catch(res => this.restExtractor.handleError(res))
+  }
 }