mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-02-25 18:55:32 -06:00
Angular application :first draft
This commit is contained in:
@@ -20,5 +20,5 @@ module.exports = router
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
function badRequest (req, res, next) {
|
||||
res.sendStatus(400)
|
||||
res.type('json').status(400).end()
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ function makeFriends (req, res, next) {
|
||||
friends.makeFriends(function (err) {
|
||||
if (err) return next(err)
|
||||
|
||||
res.sendStatus(204)
|
||||
res.type('json').status(204).end()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ function removePods (req, res, next) {
|
||||
if (err) logger.error('Cannot remove all remote videos of %s.', url)
|
||||
else logger.info('%s pod removed.', url)
|
||||
|
||||
res.sendStatus(204)
|
||||
res.type('json').status(204).end()
|
||||
})
|
||||
})
|
||||
}
|
||||
@@ -88,6 +88,6 @@ function quitFriends (req, res, next) {
|
||||
friends.quitFriends(function (err) {
|
||||
if (err) return next(err)
|
||||
|
||||
res.sendStatus(204)
|
||||
res.type('json').status(204).end()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -48,6 +48,6 @@ function removeRemoteVideo (req, res, next) {
|
||||
videos.removeRemotesOfByMagnetUris(url, magnetUris, function (err) {
|
||||
if (err) return next(err)
|
||||
|
||||
res.sendStatus(204)
|
||||
res.type('json').status(204).end()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ function addVideo (req, res, next) {
|
||||
friends.addVideoToFriends(video_data)
|
||||
|
||||
// TODO : include Location of the new video
|
||||
res.sendStatus(201)
|
||||
res.type('json').status(201).end()
|
||||
})
|
||||
})
|
||||
}
|
||||
@@ -87,7 +87,7 @@ function getVideos (req, res, next) {
|
||||
if (err) return next(err)
|
||||
|
||||
if (video === null) {
|
||||
return res.sendStatus(404)
|
||||
res.type('json').status(204).end()
|
||||
}
|
||||
|
||||
res.json(video)
|
||||
@@ -117,7 +117,7 @@ function removeVideo (req, res, next) {
|
||||
}
|
||||
|
||||
friends.removeVideoToFriends(params)
|
||||
res.sendStatus(204)
|
||||
res.type('json').status(204).end()
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user