]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/shared-instance/instance-follow.service.ts
Support ICU in TS components
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-instance / instance-follow.service.ts
index af44020cf4ef1df622ea2fe64fa07b9d941e1864..a83f7c4ad56cae17ba18c71b5826dbb0fcd29e18 100644 (file)
@@ -19,10 +19,10 @@ export class InstanceFollowService {
   }
 
   getFollowing (options: {
-    pagination: RestPagination,
-    sort: SortMeta,
-    search?: string,
-    actorType?: ActivityPubActorType,
+    pagination: RestPagination
+    sort: SortMeta
+    search?: string
+    actorType?: ActivityPubActorType
     state?: FollowState
   }): Observable<ResultList<ActorFollow>> {
     const { pagination, sort, search, state, actorType } = options
@@ -42,10 +42,10 @@ export class InstanceFollowService {
   }
 
   getFollowers (options: {
-    pagination: RestPagination,
-    sort: SortMeta,
-    search?: string,
-    actorType?: ActivityPubActorType,
+    pagination: RestPagination
+    sort: SortMeta
+    search?: string
+    actorType?: ActivityPubActorType
     state?: FollowState
   }): Observable<ResultList<ActorFollow>> {
     const { pagination, sort, search, state, actorType } = options
@@ -71,49 +71,34 @@ export class InstanceFollowService {
     }
 
     return this.authHttp.post(InstanceFollowService.BASE_APPLICATION_URL + '/following', body)
-               .pipe(
-                 map(this.restExtractor.extractDataBool),
-                 catchError(res => this.restExtractor.handleError(res))
-               )
+               .pipe(catchError(res => this.restExtractor.handleError(res)))
   }
 
   unfollow (follow: ActorFollow) {
     const handle = follow.following.name + '@' + follow.following.host
 
     return this.authHttp.delete(InstanceFollowService.BASE_APPLICATION_URL + '/following/' + handle)
-               .pipe(
-                 map(this.restExtractor.extractDataBool),
-                 catchError(res => this.restExtractor.handleError(res))
-               )
+               .pipe(catchError(res => this.restExtractor.handleError(res)))
   }
 
   acceptFollower (follow: ActorFollow) {
     const handle = follow.follower.name + '@' + follow.follower.host
 
     return this.authHttp.post(`${InstanceFollowService.BASE_APPLICATION_URL}/followers/${handle}/accept`, {})
-               .pipe(
-                 map(this.restExtractor.extractDataBool),
-                 catchError(res => this.restExtractor.handleError(res))
-               )
+               .pipe(catchError(res => this.restExtractor.handleError(res)))
   }
 
   rejectFollower (follow: ActorFollow) {
     const handle = follow.follower.name + '@' + follow.follower.host
 
     return this.authHttp.post(`${InstanceFollowService.BASE_APPLICATION_URL}/followers/${handle}/reject`, {})
-               .pipe(
-                 map(this.restExtractor.extractDataBool),
-                 catchError(res => this.restExtractor.handleError(res))
-               )
+               .pipe(catchError(res => this.restExtractor.handleError(res)))
   }
 
   removeFollower (follow: ActorFollow) {
     const handle = follow.follower.name + '@' + follow.follower.host
 
     return this.authHttp.delete(`${InstanceFollowService.BASE_APPLICATION_URL}/followers/${handle}`)
-               .pipe(
-                 map(this.restExtractor.extractDataBool),
-                 catchError(res => this.restExtractor.handleError(res))
-               )
+               .pipe(catchError(res => this.restExtractor.handleError(res)))
   }
 }