aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/instance
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-11-29 10:55:17 +0100
committerChocobozzz <me@florianbigard.com>2019-11-29 10:55:17 +0100
commit97ecddae104f4013d261f0e9645e8b319ff0f1a6 (patch)
tree74e00ace03bcdfd91684c889b866f30ec2c6d244 /client/src/app/shared/instance
parentf5b72c3937c721258c569ee783503adb379c42ab (diff)
downloadPeerTube-97ecddae104f4013d261f0e9645e8b319ff0f1a6.tar.gz
PeerTube-97ecddae104f4013d261f0e9645e8b319ff0f1a6.tar.zst
PeerTube-97ecddae104f4013d261f0e9645e8b319ff0f1a6.zip
Filter on follows actor types in about page
Diffstat (limited to 'client/src/app/shared/instance')
-rw-r--r--client/src/app/shared/instance/follow.service.ts10
1 files changed, 7 insertions, 3 deletions
diff --git a/client/src/app/shared/instance/follow.service.ts b/client/src/app/shared/instance/follow.service.ts
index 1477a26ae..ef4c09583 100644
--- a/client/src/app/shared/instance/follow.service.ts
+++ b/client/src/app/shared/instance/follow.service.ts
@@ -2,7 +2,7 @@ import { catchError, map } from 'rxjs/operators'
2import { HttpClient, HttpParams } from '@angular/common/http' 2import { HttpClient, HttpParams } from '@angular/common/http'
3import { Injectable } from '@angular/core' 3import { Injectable } from '@angular/core'
4import { Observable } from 'rxjs' 4import { Observable } from 'rxjs'
5import { ActorFollow, FollowState, ResultList } from '@shared/index' 5import { ActivityPubActorType, ActorFollow, FollowState, ResultList } from '@shared/index'
6import { environment } from '../../../environments/environment' 6import { environment } from '../../../environments/environment'
7import { RestExtractor, RestPagination, RestService } from '../rest' 7import { RestExtractor, RestPagination, RestService } from '../rest'
8import { SortMeta } from 'primeng/api' 8import { SortMeta } from 'primeng/api'
@@ -22,15 +22,17 @@ export class FollowService {
22 pagination: RestPagination, 22 pagination: RestPagination,
23 sort: SortMeta, 23 sort: SortMeta,
24 search?: string, 24 search?: string,
25 actorType?: ActivityPubActorType,
25 state?: FollowState 26 state?: FollowState
26 }): Observable<ResultList<ActorFollow>> { 27 }): Observable<ResultList<ActorFollow>> {
27 const { pagination, sort, search, state } = options 28 const { pagination, sort, search, state, actorType } = options
28 29
29 let params = new HttpParams() 30 let params = new HttpParams()
30 params = this.restService.addRestGetParams(params, pagination, sort) 31 params = this.restService.addRestGetParams(params, pagination, sort)
31 32
32 if (search) params = params.append('search', search) 33 if (search) params = params.append('search', search)
33 if (state) params = params.append('state', state) 34 if (state) params = params.append('state', state)
35 if (actorType) params = params.append('actorType', actorType)
34 36
35 return this.authHttp.get<ResultList<ActorFollow>>(FollowService.BASE_APPLICATION_URL + '/following', { params }) 37 return this.authHttp.get<ResultList<ActorFollow>>(FollowService.BASE_APPLICATION_URL + '/following', { params })
36 .pipe( 38 .pipe(
@@ -43,15 +45,17 @@ export class FollowService {
43 pagination: RestPagination, 45 pagination: RestPagination,
44 sort: SortMeta, 46 sort: SortMeta,
45 search?: string, 47 search?: string,
48 actorType?: ActivityPubActorType,
46 state?: FollowState 49 state?: FollowState
47 }): Observable<ResultList<ActorFollow>> { 50 }): Observable<ResultList<ActorFollow>> {
48 const { pagination, sort, search, state } = options 51 const { pagination, sort, search, state, actorType } = options
49 52
50 let params = new HttpParams() 53 let params = new HttpParams()
51 params = this.restService.addRestGetParams(params, pagination, sort) 54 params = this.restService.addRestGetParams(params, pagination, sort)
52 55
53 if (search) params = params.append('search', search) 56 if (search) params = params.append('search', search)
54 if (state) params = params.append('state', state) 57 if (state) params = params.append('state', state)
58 if (actorType) params = params.append('actorType', actorType)
55 59
56 return this.authHttp.get<ResultList<ActorFollow>>(FollowService.BASE_APPLICATION_URL + '/followers', { params }) 60 return this.authHttp.get<ResultList<ActorFollow>>(FollowService.BASE_APPLICATION_URL + '/followers', { params })
57 .pipe( 61 .pipe(