aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/pods.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-01-04 20:59:23 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-01-04 21:05:13 +0100
commit55fa55a9be566cca2ba95322f2ae23b434aed62a (patch)
treef51ef35c120ce8a928917a659418079538cdb8dc /server/controllers/api/pods.js
parenta6fd2b30bf717eec14972a2175354781f5f43e77 (diff)
downloadPeerTube-55fa55a9be566cca2ba95322f2ae23b434aed62a.tar.gz
PeerTube-55fa55a9be566cca2ba95322f2ae23b434aed62a.tar.zst
PeerTube-55fa55a9be566cca2ba95322f2ae23b434aed62a.zip
Server: add video abuse support
Diffstat (limited to 'server/controllers/api/pods.js')
-rw-r--r--server/controllers/api/pods.js17
1 files changed, 3 insertions, 14 deletions
diff --git a/server/controllers/api/pods.js b/server/controllers/api/pods.js
index d9279f1d9..38702face 100644
--- a/server/controllers/api/pods.js
+++ b/server/controllers/api/pods.js
@@ -5,6 +5,7 @@ const waterfall = require('async/waterfall')
5 5
6const db = require('../../initializers/database') 6const db = require('../../initializers/database')
7const logger = require('../../helpers/logger') 7const logger = require('../../helpers/logger')
8const utils = require('../../helpers/utils')
8const friends = require('../../lib/friends') 9const friends = require('../../lib/friends')
9const middlewares = require('../../middlewares') 10const middlewares = require('../../middlewares')
10const admin = middlewares.admin 11const admin = middlewares.admin
@@ -36,7 +37,7 @@ router.get('/quitfriends',
36) 37)
37// Post because this is a secured request 38// Post because this is a secured request
38router.post('/remove', 39router.post('/remove',
39 signatureValidator, 40 signatureValidator.signature,
40 checkSignature, 41 checkSignature,
41 removePods 42 removePods
42) 43)
@@ -86,7 +87,7 @@ function listPods (req, res, next) {
86 db.Pod.list(function (err, podsList) { 87 db.Pod.list(function (err, podsList) {
87 if (err) return next(err) 88 if (err) return next(err)
88 89
89 res.json(getFormatedPods(podsList)) 90 res.json(utils.getFormatedObjects(podsList, podsList.length))
90 }) 91 })
91} 92}
92 93
@@ -130,15 +131,3 @@ function quitFriends (req, res, next) {
130 res.type('json').status(204).end() 131 res.type('json').status(204).end()
131 }) 132 })
132} 133}
133
134// ---------------------------------------------------------------------------
135
136function getFormatedPods (pods) {
137 const formatedPods = []
138
139 pods.forEach(function (pod) {
140 formatedPods.push(pod.toFormatedJSON())
141 })
142
143 return formatedPods
144}