diff options
Diffstat (limited to 'server/middlewares')
-rw-r--r-- | server/middlewares/reqValidators/videos.js | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/server/middlewares/reqValidators/videos.js b/server/middlewares/reqValidators/videos.js index 4057e72cd..12e878e81 100644 --- a/server/middlewares/reqValidators/videos.js +++ b/server/middlewares/reqValidators/videos.js | |||
@@ -35,11 +35,10 @@ function videosGet (req, res, next) { | |||
35 | res.sendStatus(500) | 35 | res.sendStatus(500) |
36 | } | 36 | } |
37 | 37 | ||
38 | videos.getVideoState(video, function (state) { | 38 | const state = videos.getVideoState(video) |
39 | if (state.exist === false) return res.status(404).send('Video not found') | 39 | if (state.exist === false) return res.status(404).send('Video not found') |
40 | 40 | ||
41 | next() | 41 | next() |
42 | }) | ||
43 | }) | 42 | }) |
44 | }) | 43 | }) |
45 | } | 44 | } |
@@ -56,12 +55,11 @@ function videosRemove (req, res, next) { | |||
56 | res.sendStatus(500) | 55 | res.sendStatus(500) |
57 | } | 56 | } |
58 | 57 | ||
59 | videos.getVideoState(video, function (state) { | 58 | const state = videos.getVideoState(video) |
60 | if (state.exist === false) return res.status(404).send('Video not found') | 59 | if (state.exist === false) return res.status(404).send('Video not found') |
61 | else if (state.owned === false) return res.status(403).send('Cannot remove video of another pod') | 60 | else if (state.owned === false) return res.status(403).send('Cannot remove video of another pod') |
62 | 61 | ||
63 | next() | 62 | next() |
64 | }) | ||
65 | }) | 63 | }) |
66 | }) | 64 | }) |
67 | } | 65 | } |