diff options
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 | } | ||