aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/server/follows.ts
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 /shared/extra-utils/server/follows.ts
parentf5b72c3937c721258c569ee783503adb379c42ab (diff)
downloadPeerTube-97ecddae104f4013d261f0e9645e8b319ff0f1a6.tar.gz
PeerTube-97ecddae104f4013d261f0e9645e8b319ff0f1a6.tar.zst
PeerTube-97ecddae104f4013d261f0e9645e8b319ff0f1a6.zip
Filter on follows actor types in about page
Diffstat (limited to 'shared/extra-utils/server/follows.ts')
-rw-r--r--shared/extra-utils/server/follows.ts32
1 files changed, 26 insertions, 6 deletions
diff --git a/shared/extra-utils/server/follows.ts b/shared/extra-utils/server/follows.ts
index 365263a22..3f7729c20 100644
--- a/shared/extra-utils/server/follows.ts
+++ b/shared/extra-utils/server/follows.ts
@@ -2,9 +2,18 @@ import * as request from 'supertest'
2import { ServerInfo } from './servers' 2import { ServerInfo } from './servers'
3import { waitJobs } from './jobs' 3import { waitJobs } from './jobs'
4import { makePostBodyRequest } from '../requests/requests' 4import { makePostBodyRequest } from '../requests/requests'
5import { FollowState } from '@shared/models' 5import { ActivityPubActorType, FollowState } from '@shared/models'
6 6
7function getFollowersListPaginationAndSort (url: string, start: number, count: number, sort: string, search?: string, state?: FollowState) { 7function getFollowersListPaginationAndSort (options: {
8 url: string,
9 start: number,
10 count: number,
11 sort: string,
12 search?: string,
13 actorType?: ActivityPubActorType,
14 state?: FollowState
15}) {
16 const { url, start, count, sort, search, state, actorType } = options
8 const path = '/api/v1/server/followers' 17 const path = '/api/v1/server/followers'
9 18
10 const query = { 19 const query = {
@@ -12,7 +21,8 @@ function getFollowersListPaginationAndSort (url: string, start: number, count: n
12 count, 21 count,
13 sort, 22 sort,
14 search, 23 search,
15 state 24 state,
25 actorType
16 } 26 }
17 27
18 return request(url) 28 return request(url)
@@ -45,7 +55,16 @@ function rejectFollower (url: string, token: string, follower: string, statusCod
45 }) 55 })
46} 56}
47 57
48function getFollowingListPaginationAndSort (url: string, start: number, count: number, sort: string, search?: string, state?: FollowState) { 58function getFollowingListPaginationAndSort (options: {
59 url: string,
60 start: number,
61 count: number,
62 sort: string,
63 search?: string,
64 actorType?: ActivityPubActorType,
65 state?: FollowState
66}) {
67 const { url, start, count, sort, search, state, actorType } = options
49 const path = '/api/v1/server/following' 68 const path = '/api/v1/server/following'
50 69
51 const query = { 70 const query = {
@@ -53,7 +72,8 @@ function getFollowingListPaginationAndSort (url: string, start: number, count: n
53 count, 72 count,
54 sort, 73 sort,
55 search, 74 search,
56 state 75 state,
76 actorType
57 } 77 }
58 78
59 return request(url) 79 return request(url)