]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/controllers/api/videos/ownership.ts
refactor API errors to standard error format
[github/Chocobozzz/PeerTube.git] / server / controllers / api / videos / ownership.ts
index 6102f28dc01794901ffac2c87c2a005d83a142c8..2d6ca60a821eba6051d89daacce8ead0353479c5 100644 (file)
@@ -122,7 +122,7 @@ function acceptOwnership (req: express.Request, res: express.Response) {
     videoChangeOwnership.status = VideoChangeOwnershipStatus.ACCEPTED
     await videoChangeOwnership.save({ transaction: t })
 
-    return res.sendStatus(HttpStatusCode.NO_CONTENT_204)
+    return res.status(HttpStatusCode.NO_CONTENT_204).end()
   })
 }
 
@@ -133,6 +133,6 @@ function refuseOwnership (req: express.Request, res: express.Response) {
     videoChangeOwnership.status = VideoChangeOwnershipStatus.REFUSED
     await videoChangeOwnership.save({ transaction: t })
 
-    return res.sendStatus(HttpStatusCode.NO_CONTENT_204)
+    return res.status(HttpStatusCode.NO_CONTENT_204).end()
   })
 }