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/users.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/users.js')
-rw-r--r-- | server/controllers/api/users.js | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/server/controllers/api/users.js b/server/controllers/api/users.js index 53bf56790..6cd0e84f7 100644 --- a/server/controllers/api/users.js +++ b/server/controllers/api/users.js | |||
@@ -6,6 +6,7 @@ const waterfall = require('async/waterfall') | |||
6 | const constants = require('../../initializers/constants') | 6 | const constants = require('../../initializers/constants') |
7 | const db = require('../../initializers/database') | 7 | const db = require('../../initializers/database') |
8 | const logger = require('../../helpers/logger') | 8 | const logger = require('../../helpers/logger') |
9 | const utils = require('../../helpers/utils') | ||
9 | const middlewares = require('../../middlewares') | 10 | const middlewares = require('../../middlewares') |
10 | const admin = middlewares.admin | 11 | const admin = middlewares.admin |
11 | const oAuth = middlewares.oauth | 12 | const oAuth = middlewares.oauth |
@@ -82,7 +83,7 @@ function listUsers (req, res, next) { | |||
82 | db.User.listForApi(req.query.start, req.query.count, req.query.sort, function (err, usersList, usersTotal) { | 83 | db.User.listForApi(req.query.start, req.query.count, req.query.sort, function (err, usersList, usersTotal) { |
83 | if (err) return next(err) | 84 | if (err) return next(err) |
84 | 85 | ||
85 | res.json(getFormatedUsers(usersList, usersTotal)) | 86 | res.json(utils.getFormatedObjects(usersList, usersTotal)) |
86 | }) | 87 | }) |
87 | } | 88 | } |
88 | 89 | ||
@@ -121,18 +122,3 @@ function updateUser (req, res, next) { | |||
121 | function success (req, res, next) { | 122 | function success (req, res, next) { |
122 | res.end() | 123 | res.end() |
123 | } | 124 | } |
124 | |||
125 | // --------------------------------------------------------------------------- | ||
126 | |||
127 | function getFormatedUsers (users, usersTotal) { | ||
128 | const formatedUsers = [] | ||
129 | |||
130 | users.forEach(function (user) { | ||
131 | formatedUsers.push(user.toFormatedJSON()) | ||
132 | }) | ||
133 | |||
134 | return { | ||
135 | total: usersTotal, | ||
136 | data: formatedUsers | ||
137 | } | ||
138 | } | ||