X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=shared%2Fextra-utils%2Fserver%2Ffollows.ts;h=006d591995aed439baf9b9ca787383ae81f102a6;hb=cdd8f7790c759664fe4d0962efa550cf1a8e37eb;hp=365263a223df5e36d6d6ef27df4562f9fbd1ac31;hpb=b8f4167fb6fa448125aeecff80b201d74e27fe6a;p=github%2FChocobozzz%2FPeerTube.git diff --git a/shared/extra-utils/server/follows.ts b/shared/extra-utils/server/follows.ts index 365263a22..006d59199 100644 --- a/shared/extra-utils/server/follows.ts +++ b/shared/extra-utils/server/follows.ts @@ -2,9 +2,18 @@ import * as request from 'supertest' import { ServerInfo } from './servers' import { waitJobs } from './jobs' import { makePostBodyRequest } from '../requests/requests' -import { FollowState } from '@shared/models' - -function getFollowersListPaginationAndSort (url: string, start: number, count: number, sort: string, search?: string, state?: FollowState) { +import { ActivityPubActorType, FollowState } from '@shared/models' + +function getFollowersListPaginationAndSort (options: { + url: string + start: number + count: number + sort: string + search?: string + actorType?: ActivityPubActorType + state?: FollowState +}) { + const { url, start, count, sort, search, state, actorType } = options const path = '/api/v1/server/followers' const query = { @@ -12,7 +21,8 @@ function getFollowersListPaginationAndSort (url: string, start: number, count: n count, sort, search, - state + state, + actorType } return request(url) @@ -45,7 +55,16 @@ function rejectFollower (url: string, token: string, follower: string, statusCod }) } -function getFollowingListPaginationAndSort (url: string, start: number, count: number, sort: string, search?: string, state?: FollowState) { +function getFollowingListPaginationAndSort (options: { + url: string + start: number + count: number + sort: string + search?: string + actorType?: ActivityPubActorType + state?: FollowState +}) { + const { url, start, count, sort, search, state, actorType } = options const path = '/api/v1/server/following' const query = { @@ -53,7 +72,8 @@ function getFollowingListPaginationAndSort (url: string, start: number, count: n count, sort, search, - state + state, + actorType } return request(url) @@ -72,7 +92,7 @@ function follow (follower: string, following: string[], accessToken: string, exp .post(path) .set('Accept', 'application/json') .set('Authorization', 'Bearer ' + accessToken) - .send({ 'hosts': followingHosts }) + .send({ hosts: followingHosts }) .expect(expectedStatus) }