diff options
Diffstat (limited to 'shared')
-rw-r--r-- | shared/extra-utils/actors/actors.ts | 18 | ||||
-rw-r--r-- | shared/extra-utils/index.ts | 1 |
2 files changed, 19 insertions, 0 deletions
diff --git a/shared/extra-utils/actors/actors.ts b/shared/extra-utils/actors/actors.ts new file mode 100644 index 000000000..4a4aba775 --- /dev/null +++ b/shared/extra-utils/actors/actors.ts | |||
@@ -0,0 +1,18 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | ||
2 | |||
3 | import { makeGetRequest } from '../requests/requests' | ||
4 | import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' | ||
5 | |||
6 | function getActor (url: string, actorName: string, statusCodeExpected = HttpStatusCode.OK_200) { | ||
7 | const path = '/api/v1/actors/' + actorName | ||
8 | |||
9 | return makeGetRequest({ | ||
10 | url, | ||
11 | path, | ||
12 | statusCodeExpected | ||
13 | }) | ||
14 | } | ||
15 | |||
16 | export { | ||
17 | getActor | ||
18 | } | ||
diff --git a/shared/extra-utils/index.ts b/shared/extra-utils/index.ts index 898a92d43..5c520d0c2 100644 --- a/shared/extra-utils/index.ts +++ b/shared/extra-utils/index.ts | |||
@@ -1,3 +1,4 @@ | |||
1 | export * from './actors/actors' | ||
1 | export * from './bulk/bulk' | 2 | export * from './bulk/bulk' |
2 | export * from './cli/cli' | 3 | export * from './cli/cli' |
3 | export * from './feeds/feeds' | 4 | export * from './feeds/feeds' |