diff options
Diffstat (limited to 'shared/extra-utils/users')
-rw-r--r-- | shared/extra-utils/users/accounts-command.ts | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/shared/extra-utils/users/accounts-command.ts b/shared/extra-utils/users/accounts-command.ts index 2f586104e..98d9d5927 100644 --- a/shared/extra-utils/users/accounts-command.ts +++ b/shared/extra-utils/users/accounts-command.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { HttpStatusCode, ResultList } from '@shared/models' | 1 | import { HttpStatusCode, ResultList } from '@shared/models' |
2 | import { Account } from '../../models/actors' | 2 | import { Account, ActorFollow } from '../../models/actors' |
3 | import { AccountVideoRate, VideoRateType } from '../../models/videos' | 3 | import { AccountVideoRate, VideoRateType } from '../../models/videos' |
4 | import { AbstractCommand, OverrideCommandOptions } from '../shared' | 4 | import { AbstractCommand, OverrideCommandOptions } from '../shared' |
5 | 5 | ||
@@ -53,4 +53,26 @@ export class AccountsCommand extends AbstractCommand { | |||
53 | defaultExpectedStatus: HttpStatusCode.OK_200 | 53 | defaultExpectedStatus: HttpStatusCode.OK_200 |
54 | }) | 54 | }) |
55 | } | 55 | } |
56 | |||
57 | listFollowers (options: OverrideCommandOptions & { | ||
58 | accountName: string | ||
59 | start?: number | ||
60 | count?: number | ||
61 | sort?: string | ||
62 | search?: string | ||
63 | }) { | ||
64 | const { accountName, start, count, sort, search } = options | ||
65 | const path = '/api/v1/accounts/' + accountName + '/followers' | ||
66 | |||
67 | const query = { start, count, sort, search } | ||
68 | |||
69 | return this.getRequestBody<ResultList<ActorFollow>>({ | ||
70 | ...options, | ||
71 | |||
72 | path, | ||
73 | query, | ||
74 | implicitToken: true, | ||
75 | defaultExpectedStatus: HttpStatusCode.OK_200 | ||
76 | }) | ||
77 | } | ||
56 | } | 78 | } |