aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/reqValidators/videos.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-03-18 16:28:09 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-03-18 16:28:09 +0100
commit2df82d42cb57783cd90ccfc11fc8ffe4b95ebb70 (patch)
tree9c177f135a121ee34ed2e4f529dd2cacc3ad3f87 /server/middlewares/reqValidators/videos.js
parentf0f5567b6918fc60c8cab15e13aec03a89a91dfb (diff)
downloadPeerTube-2df82d42cb57783cd90ccfc11fc8ffe4b95ebb70.tar.gz
PeerTube-2df82d42cb57783cd90ccfc11fc8ffe4b95ebb70.tar.zst
PeerTube-2df82d42cb57783cd90ccfc11fc8ffe4b95ebb70.zip
Change api output for videos
Diffstat (limited to 'server/middlewares/reqValidators/videos.js')
-rw-r--r--server/middlewares/reqValidators/videos.js16
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}