]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/controllers/api/abuse.ts
Adapt CLI to new commands
[github/Chocobozzz/PeerTube.git] / server / controllers / api / abuse.ts
index 0ab74bdff00add15fe79537fcff0b7a3c1e8579a..ba5b948405480708a50e7f24b1017e29fdc5ca94 100644 (file)
@@ -24,6 +24,7 @@ import {
   deleteAbuseMessageValidator,
   ensureUserHasRight,
   getAbuseValidator,
+  openapiOperationDoc,
   paginationValidator,
   setDefaultPagination,
   setDefaultSort
@@ -33,6 +34,7 @@ import { AccountModel } from '../../models/account/account'
 const abuseRouter = express.Router()
 
 abuseRouter.get('/',
+  openapiOperationDoc({ operationId: 'getAbuses' }),
   authenticate,
   ensureUserHasRight(UserRight.MANAGE_ABUSES),
   paginationValidator,
@@ -142,7 +144,7 @@ async function updateAbuse (req: express.Request, res: express.Response) {
 
   // Do not send the delete to other instances, we updated OUR copy of this abuse
 
-  return res.sendStatus(HttpStatusCode.NO_CONTENT_204)
+  return res.status(HttpStatusCode.NO_CONTENT_204).end()
 }
 
 async function deleteAbuse (req: express.Request, res: express.Response) {
@@ -154,7 +156,7 @@ async function deleteAbuse (req: express.Request, res: express.Response) {
 
   // Do not send the delete to other instances, we delete OUR copy of this abuse
 
-  return res.sendStatus(HttpStatusCode.NO_CONTENT_204)
+  return res.status(HttpStatusCode.NO_CONTENT_204).end()
 }
 
 async function reportAbuse (req: express.Request, res: express.Response) {
@@ -244,5 +246,5 @@ async function deleteAbuseMessage (req: express.Request, res: express.Response)
     return abuseMessage.destroy({ transaction: t })
   })
 
-  return res.sendStatus(HttpStatusCode.NO_CONTENT_204)
+  return res.status(HttpStatusCode.NO_CONTENT_204).end()
 }