diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2021-06-01 01:36:53 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2021-06-02 16:57:07 +0200 |
commit | 76148b27f7501bac061992136852be4303370c8d (patch) | |
tree | fc0559253e833c9252fa14ebaec5321d88bfb4e8 /server/controllers/api/videos/blacklist.ts | |
parent | 5ed25fb76e920dac364cb9ef46f14ec4bd372949 (diff) | |
download | PeerTube-76148b27f7501bac061992136852be4303370c8d.tar.gz PeerTube-76148b27f7501bac061992136852be4303370c8d.tar.zst PeerTube-76148b27f7501bac061992136852be4303370c8d.zip |
refactor API errors to standard error format
Diffstat (limited to 'server/controllers/api/videos/blacklist.ts')
-rw-r--r-- | server/controllers/api/videos/blacklist.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/controllers/api/videos/blacklist.ts b/server/controllers/api/videos/blacklist.ts index fa8448c86..ca2b85ea5 100644 --- a/server/controllers/api/videos/blacklist.ts +++ b/server/controllers/api/videos/blacklist.ts | |||
@@ -70,7 +70,7 @@ async function addVideoToBlacklistController (req: express.Request, res: express | |||
70 | 70 | ||
71 | logger.info('Video %s blacklisted.', videoInstance.uuid) | 71 | logger.info('Video %s blacklisted.', videoInstance.uuid) |
72 | 72 | ||
73 | return res.type('json').sendStatus(HttpStatusCode.NO_CONTENT_204) | 73 | return res.type('json').status(HttpStatusCode.NO_CONTENT_204).end() |
74 | } | 74 | } |
75 | 75 | ||
76 | async function updateVideoBlacklistController (req: express.Request, res: express.Response) { | 76 | async function updateVideoBlacklistController (req: express.Request, res: express.Response) { |
@@ -82,7 +82,7 @@ async function updateVideoBlacklistController (req: express.Request, res: expres | |||
82 | return videoBlacklist.save({ transaction: t }) | 82 | return videoBlacklist.save({ transaction: t }) |
83 | }) | 83 | }) |
84 | 84 | ||
85 | return res.type('json').sendStatus(HttpStatusCode.NO_CONTENT_204) | 85 | return res.type('json').status(HttpStatusCode.NO_CONTENT_204).end() |
86 | } | 86 | } |
87 | 87 | ||
88 | async function listBlacklist (req: express.Request, res: express.Response) { | 88 | async function listBlacklist (req: express.Request, res: express.Response) { |
@@ -105,5 +105,5 @@ async function removeVideoFromBlacklistController (req: express.Request, res: ex | |||
105 | 105 | ||
106 | logger.info('Video %s removed from blacklist.', video.uuid) | 106 | logger.info('Video %s removed from blacklist.', video.uuid) |
107 | 107 | ||
108 | return res.type('json').sendStatus(HttpStatusCode.NO_CONTENT_204) | 108 | return res.type('json').status(HttpStatusCode.NO_CONTENT_204).end() |
109 | } | 109 | } |