]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/controllers/api/server/redundancy.ts
replace numbers with typed http status codes (#3409)
[github/Chocobozzz/PeerTube.git] / server / controllers / api / server / redundancy.ts
index 1ced0759e9d0a2d4558f415b5ae22621a07a3993..7c13dc21b67df58abb972beef8d0e08325cf4359 100644 (file)
@@ -19,6 +19,7 @@ import { removeRedundanciesOfServer, removeVideoRedundancy } from '../../../lib/
 import { logger } from '../../../helpers/logger'
 import { VideoRedundancyModel } from '@server/models/redundancy/video-redundancy'
 import { JobQueue } from '@server/lib/job-queue'
+import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
 
 const serverRedundancyRouter = express.Router()
 
@@ -89,13 +90,13 @@ async function addVideoRedundancy (req: express.Request, res: express.Response)
     payload
   })
 
-  return res.sendStatus(204)
+  return res.sendStatus(HttpStatusCode.NO_CONTENT_204)
 }
 
 async function removeVideoRedundancyController (req: express.Request, res: express.Response) {
   await removeVideoRedundancy(res.locals.videoRedundancy)
 
-  return res.sendStatus(204)
+  return res.sendStatus(HttpStatusCode.NO_CONTENT_204)
 }
 
 async function updateRedundancy (req: express.Request, res: express.Response) {
@@ -109,5 +110,5 @@ async function updateRedundancy (req: express.Request, res: express.Response) {
   removeRedundanciesOfServer(server.id)
     .catch(err => logger.error('Cannot remove redundancy of %s.', server.host, { err }))
 
-  return res.sendStatus(204)
+  return res.sendStatus(HttpStatusCode.NO_CONTENT_204)
 }