1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 19:42:24 +02:00

Angular application :first draft

This commit is contained in:
Chocobozzz 2016-03-14 13:50:19 +01:00
parent bd324a6692
commit dc8bc31be5
34 changed files with 509 additions and 192 deletions

View file

@ -20,5 +20,5 @@ module.exports = router
// ---------------------------------------------------------------------------
function badRequest (req, res, next) {
res.sendStatus(400)
res.type('json').status(400).end()
}

View file

@ -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()
})
}

View file

@ -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()
})
}

View file

@ -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()
})
})
})