1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 02:39:33 +02:00

replace numbers with typed http status codes (#3409)

This commit is contained in:
Rigel Kent 2020-12-07 14:32:36 +01:00 committed by GitHub
parent adc1f09c0d
commit 2d53be0267
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
149 changed files with 1721 additions and 1108 deletions

View file

@ -1,6 +1,6 @@
import { makeDeleteRequest, makeGetRequest, makePutBodyRequest } from '../requests/requests'
import { CustomConfig } from '../../models/server/custom-config.model'
import { DeepPartial } from '@shared/core-utils'
import { DeepPartial, HttpStatusCode } from '@shared/core-utils'
import { merge } from 'lodash'
function getConfig (url: string) {
@ -9,7 +9,7 @@ function getConfig (url: string) {
return makeGetRequest({
url,
path,
statusCodeExpected: 200
statusCodeExpected: HttpStatusCode.OK_200
})
}
@ -19,11 +19,11 @@ function getAbout (url: string) {
return makeGetRequest({
url,
path,
statusCodeExpected: 200
statusCodeExpected: HttpStatusCode.OK_200
})
}
function getCustomConfig (url: string, token: string, statusCodeExpected = 200) {
function getCustomConfig (url: string, token: string, statusCodeExpected = HttpStatusCode.OK_200) {
const path = '/api/v1/config/custom'
return makeGetRequest({
@ -34,7 +34,7 @@ function getCustomConfig (url: string, token: string, statusCodeExpected = 200)
})
}
function updateCustomConfig (url: string, token: string, newCustomConfig: CustomConfig, statusCodeExpected = 200) {
function updateCustomConfig (url: string, token: string, newCustomConfig: CustomConfig, statusCodeExpected = HttpStatusCode.OK_200) {
const path = '/api/v1/config/custom'
return makePutBodyRequest({
@ -204,7 +204,7 @@ function updateCustomSubConfig (url: string, token: string, newConfig: DeepParti
return updateCustomConfig(url, token, updateParams)
}
function deleteCustomConfig (url: string, token: string, statusCodeExpected = 200) {
function deleteCustomConfig (url: string, token: string, statusCodeExpected = HttpStatusCode.OK_200) {
const path = '/api/v1/config/custom'
return makeDeleteRequest({