diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-01-04 20:59:23 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-01-04 21:05:13 +0100 |
commit | 55fa55a9be566cca2ba95322f2ae23b434aed62a (patch) | |
tree | f51ef35c120ce8a928917a659418079538cdb8dc /server/controllers/api/pods.js | |
parent | a6fd2b30bf717eec14972a2175354781f5f43e77 (diff) | |
download | PeerTube-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.js | 17 |
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 | ||
6 | const db = require('../../initializers/database') | 6 | const db = require('../../initializers/database') |
7 | const logger = require('../../helpers/logger') | 7 | const logger = require('../../helpers/logger') |
8 | const utils = require('../../helpers/utils') | ||
8 | const friends = require('../../lib/friends') | 9 | const friends = require('../../lib/friends') |
9 | const middlewares = require('../../middlewares') | 10 | const middlewares = require('../../middlewares') |
10 | const admin = middlewares.admin | 11 | const 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 |
38 | router.post('/remove', | 39 | router.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 | |||
136 | function getFormatedPods (pods) { | ||
137 | const formatedPods = [] | ||
138 | |||
139 | pods.forEach(function (pod) { | ||
140 | formatedPods.push(pod.toFormatedJSON()) | ||
141 | }) | ||
142 | |||
143 | return formatedPods | ||
144 | } | ||