diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-12-07 14:32:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-07 14:32:36 +0100 |
commit | 2d53be0267acc49cda46707b885096193a1f4e9c (patch) | |
tree | 887061a34bc67f40acbb96a6278f9544bf83caeb /shared/extra-utils/server/jobs.ts | |
parent | adc1f09c0dbd997f34028c1c82d1c118dc8ead80 (diff) | |
download | PeerTube-2d53be0267acc49cda46707b885096193a1f4e9c.tar.gz PeerTube-2d53be0267acc49cda46707b885096193a1f4e9c.tar.zst PeerTube-2d53be0267acc49cda46707b885096193a1f4e9c.zip |
replace numbers with typed http status codes (#3409)
Diffstat (limited to 'shared/extra-utils/server/jobs.ts')
-rw-r--r-- | shared/extra-utils/server/jobs.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/shared/extra-utils/server/jobs.ts b/shared/extra-utils/server/jobs.ts index d984b3d1e..cac00e9ab 100644 --- a/shared/extra-utils/server/jobs.ts +++ b/shared/extra-utils/server/jobs.ts | |||
@@ -3,6 +3,7 @@ import { Job, JobState, JobType } from '../../models' | |||
3 | import { wait } from '../miscs/miscs' | 3 | import { wait } from '../miscs/miscs' |
4 | import { ServerInfo } from './servers' | 4 | import { ServerInfo } from './servers' |
5 | import { makeGetRequest } from '../../../shared/extra-utils' | 5 | import { makeGetRequest } from '../../../shared/extra-utils' |
6 | import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' | ||
6 | 7 | ||
7 | function getJobsList (url: string, accessToken: string, state: JobState) { | 8 | function getJobsList (url: string, accessToken: string, state: JobState) { |
8 | const path = '/api/v1/jobs/' + state | 9 | const path = '/api/v1/jobs/' + state |
@@ -11,7 +12,7 @@ function getJobsList (url: string, accessToken: string, state: JobState) { | |||
11 | .get(path) | 12 | .get(path) |
12 | .set('Accept', 'application/json') | 13 | .set('Accept', 'application/json') |
13 | .set('Authorization', 'Bearer ' + accessToken) | 14 | .set('Authorization', 'Bearer ' + accessToken) |
14 | .expect(200) | 15 | .expect(HttpStatusCode.OK_200) |
15 | .expect('Content-Type', /json/) | 16 | .expect('Content-Type', /json/) |
16 | } | 17 | } |
17 | 18 | ||
@@ -38,7 +39,7 @@ function getJobsListPaginationAndSort (options: { | |||
38 | url, | 39 | url, |
39 | path, | 40 | path, |
40 | token: accessToken, | 41 | token: accessToken, |
41 | statusCodeExpected: 200, | 42 | statusCodeExpected: HttpStatusCode.OK_200, |
42 | query | 43 | query |
43 | }) | 44 | }) |
44 | } | 45 | } |