mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 02:39:33 +02:00
Introduce server commands
This commit is contained in:
parent
0d8ecb7592
commit
6c5065a011
63 changed files with 688 additions and 708 deletions
|
@ -1,13 +1,12 @@
|
|||
import { HttpStatusCode } from '@shared/core-utils'
|
||||
import { makeGetRequest } from './requests'
|
||||
import { immutableAssign } from '../miscs/miscs'
|
||||
import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
|
||||
|
||||
function checkBadStartPagination (url: string, path: string, token?: string, query = {}) {
|
||||
return makeGetRequest({
|
||||
url,
|
||||
path,
|
||||
token,
|
||||
query: immutableAssign(query, { start: 'hello' }),
|
||||
query: { ...query, start: 'hello' },
|
||||
statusCodeExpected: HttpStatusCode.BAD_REQUEST_400
|
||||
})
|
||||
}
|
||||
|
@ -17,7 +16,7 @@ async function checkBadCountPagination (url: string, path: string, token?: strin
|
|||
url,
|
||||
path,
|
||||
token,
|
||||
query: immutableAssign(query, { count: 'hello' }),
|
||||
query: { ...query, count: 'hello' },
|
||||
statusCodeExpected: HttpStatusCode.BAD_REQUEST_400
|
||||
})
|
||||
|
||||
|
@ -25,7 +24,7 @@ async function checkBadCountPagination (url: string, path: string, token?: strin
|
|||
url,
|
||||
path,
|
||||
token,
|
||||
query: immutableAssign(query, { count: 2000 }),
|
||||
query: { ...query, count: 2000 },
|
||||
statusCodeExpected: HttpStatusCode.BAD_REQUEST_400
|
||||
})
|
||||
}
|
||||
|
@ -35,7 +34,7 @@ function checkBadSortPagination (url: string, path: string, token?: string, quer
|
|||
url,
|
||||
path,
|
||||
token,
|
||||
query: immutableAssign(query, { sort: 'hello' }),
|
||||
query: { ...query, sort: 'hello' },
|
||||
statusCodeExpected: HttpStatusCode.BAD_REQUEST_400
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue