1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 02:09:37 +02:00

Server: add video abuse support

This commit is contained in:
Chocobozzz 2017-01-04 20:59:23 +01:00
parent a6fd2b30bf
commit 55fa55a9be
32 changed files with 921 additions and 175 deletions

View file

@ -8,7 +8,8 @@ const utils = {
badRequest,
cleanForExit,
generateRandomString,
isTestInstance
isTestInstance,
getFormatedObjects
}
function badRequest (req, res, next) {
@ -32,6 +33,19 @@ function isTestInstance () {
return (process.env.NODE_ENV === 'test')
}
function getFormatedObjects (objects, objectsTotal) {
const formatedObjects = []
objects.forEach(function (object) {
formatedObjects.push(object.toFormatedJSON())
})
return {
total: objectsTotal,
data: formatedObjects
}
}
// ---------------------------------------------------------------------------
module.exports = utils