aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/requests/check-api-params.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-16 10:42:24 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:18 +0200
commitc0e8b12e7fd554ba4d2ceb0c4900804c6a4c63ea (patch)
treebaf29753ac5d4598643e3bee719f8df0cc36c59d /shared/extra-utils/requests/check-api-params.ts
parent08642a765ea514a00f159db898edf14c376fbe6c (diff)
downloadPeerTube-c0e8b12e7fd554ba4d2ceb0c4900804c6a4c63ea.tar.gz
PeerTube-c0e8b12e7fd554ba4d2ceb0c4900804c6a4c63ea.tar.zst
PeerTube-c0e8b12e7fd554ba4d2ceb0c4900804c6a4c63ea.zip
Refactor requests
Diffstat (limited to 'shared/extra-utils/requests/check-api-params.ts')
-rw-r--r--shared/extra-utils/requests/check-api-params.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/shared/extra-utils/requests/check-api-params.ts b/shared/extra-utils/requests/check-api-params.ts
index 7df63b004..26ba1e913 100644
--- a/shared/extra-utils/requests/check-api-params.ts
+++ b/shared/extra-utils/requests/check-api-params.ts
@@ -1,4 +1,4 @@
1import { HttpStatusCode } from '@shared/core-utils' 1import { HttpStatusCode } from '@shared/models'
2import { makeGetRequest } from './requests' 2import { makeGetRequest } from './requests'
3 3
4function checkBadStartPagination (url: string, path: string, token?: string, query = {}) { 4function checkBadStartPagination (url: string, path: string, token?: string, query = {}) {
@@ -7,7 +7,7 @@ function checkBadStartPagination (url: string, path: string, token?: string, que
7 path, 7 path,
8 token, 8 token,
9 query: { ...query, start: 'hello' }, 9 query: { ...query, start: 'hello' },
10 statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 10 expectedStatus: HttpStatusCode.BAD_REQUEST_400
11 }) 11 })
12} 12}
13 13
@@ -17,7 +17,7 @@ async function checkBadCountPagination (url: string, path: string, token?: strin
17 path, 17 path,
18 token, 18 token,
19 query: { ...query, count: 'hello' }, 19 query: { ...query, count: 'hello' },
20 statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 20 expectedStatus: HttpStatusCode.BAD_REQUEST_400
21 }) 21 })
22 22
23 await makeGetRequest({ 23 await makeGetRequest({
@@ -25,7 +25,7 @@ async function checkBadCountPagination (url: string, path: string, token?: strin
25 path, 25 path,
26 token, 26 token,
27 query: { ...query, count: 2000 }, 27 query: { ...query, count: 2000 },
28 statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 28 expectedStatus: HttpStatusCode.BAD_REQUEST_400
29 }) 29 })
30} 30}
31 31
@@ -35,7 +35,7 @@ function checkBadSortPagination (url: string, path: string, token?: string, quer
35 path, 35 path,
36 token, 36 token,
37 query: { ...query, sort: 'hello' }, 37 query: { ...query, sort: 'hello' },
38 statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 38 expectedStatus: HttpStatusCode.BAD_REQUEST_400
39 }) 39 })
40} 40}
41 41