aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/requests/check-api-params.ts
diff options
context:
space:
mode:
Diffstat (limited to 'shared/extra-utils/requests/check-api-params.ts')
-rw-r--r--shared/extra-utils/requests/check-api-params.ts11
1 files changed, 5 insertions, 6 deletions
diff --git a/shared/extra-utils/requests/check-api-params.ts b/shared/extra-utils/requests/check-api-params.ts
index 7f5ff775c..7df63b004 100644
--- a/shared/extra-utils/requests/check-api-params.ts
+++ b/shared/extra-utils/requests/check-api-params.ts
@@ -1,13 +1,12 @@
1import { HttpStatusCode } from '@shared/core-utils'
1import { makeGetRequest } from './requests' 2import { makeGetRequest } from './requests'
2import { immutableAssign } from '../miscs/miscs'
3import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
4 3
5function checkBadStartPagination (url: string, path: string, token?: string, query = {}) { 4function checkBadStartPagination (url: string, path: string, token?: string, query = {}) {
6 return makeGetRequest({ 5 return makeGetRequest({
7 url, 6 url,
8 path, 7 path,
9 token, 8 token,
10 query: immutableAssign(query, { start: 'hello' }), 9 query: { ...query, start: 'hello' },
11 statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 10 statusCodeExpected: HttpStatusCode.BAD_REQUEST_400
12 }) 11 })
13} 12}
@@ -17,7 +16,7 @@ async function checkBadCountPagination (url: string, path: string, token?: strin
17 url, 16 url,
18 path, 17 path,
19 token, 18 token,
20 query: immutableAssign(query, { count: 'hello' }), 19 query: { ...query, count: 'hello' },
21 statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 20 statusCodeExpected: HttpStatusCode.BAD_REQUEST_400
22 }) 21 })
23 22
@@ -25,7 +24,7 @@ async function checkBadCountPagination (url: string, path: string, token?: strin
25 url, 24 url,
26 path, 25 path,
27 token, 26 token,
28 query: immutableAssign(query, { count: 2000 }), 27 query: { ...query, count: 2000 },
29 statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 28 statusCodeExpected: HttpStatusCode.BAD_REQUEST_400
30 }) 29 })
31} 30}
@@ -35,7 +34,7 @@ function checkBadSortPagination (url: string, path: string, token?: string, quer
35 url, 34 url,
36 path, 35 path,
37 token, 36 token,
38 query: immutableAssign(query, { sort: 'hello' }), 37 query: { ...query, sort: 'hello' },
39 statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 38 statusCodeExpected: HttpStatusCode.BAD_REQUEST_400
40 }) 39 })
41} 40}