aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/pods.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-03-19 18:56:10 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-03-19 18:56:10 +0100
commit34831b4843c161248109fb10876c1600578491de (patch)
treedb478bf3819c844a6b54da5b031a27b74f20aeeb /server/controllers/api/pods.js
parentf148e5edb62c914eff12d7d4a5f879fedcfc64be (diff)
downloadPeerTube-34831b4843c161248109fb10876c1600578491de.tar.gz
PeerTube-34831b4843c161248109fb10876c1600578491de.tar.zst
PeerTube-34831b4843c161248109fb10876c1600578491de.zip
Server: move pod remove to remote path
Diffstat (limited to 'server/controllers/api/pods.js')
-rw-r--r--server/controllers/api/pods.js26
1 files changed, 0 insertions, 26 deletions
diff --git a/server/controllers/api/pods.js b/server/controllers/api/pods.js
index 1c3eefcc1..ab5763cf6 100644
--- a/server/controllers/api/pods.js
+++ b/server/controllers/api/pods.js
@@ -13,9 +13,7 @@ const middlewares = require('../../middlewares')
13const admin = middlewares.admin 13const admin = middlewares.admin
14const oAuth = middlewares.oauth 14const oAuth = middlewares.oauth
15const podsMiddleware = middlewares.pods 15const podsMiddleware = middlewares.pods
16const checkSignature = middlewares.secure.checkSignature
17const validators = middlewares.validators.pods 16const validators = middlewares.validators.pods
18const signatureValidator = middlewares.validators.remote.signature
19 17
20const router = express.Router() 18const router = express.Router()
21 19
@@ -37,12 +35,6 @@ router.get('/quitfriends',
37 admin.ensureIsAdmin, 35 admin.ensureIsAdmin,
38 quitFriends 36 quitFriends
39) 37)
40// Post because this is a secured request
41router.post('/remove',
42 signatureValidator.signature,
43 checkSignature,
44 removePods
45)
46 38
47// --------------------------------------------------------------------------- 39// ---------------------------------------------------------------------------
48 40
@@ -108,24 +100,6 @@ function makeFriends (req, res, next) {
108 res.type('json').status(204).end() 100 res.type('json').status(204).end()
109} 101}
110 102
111function removePods (req, res, next) {
112 const host = req.body.signature.host
113
114 waterfall([
115 function loadPod (callback) {
116 db.Pod.loadByHost(host, callback)
117 },
118
119 function deletePod (pod, callback) {
120 pod.destroy().asCallback(callback)
121 }
122 ], function (err) {
123 if (err) return next(err)
124
125 return res.type('json').status(204).end()
126 })
127}
128
129function quitFriends (req, res, next) { 103function quitFriends (req, res, next) {
130 friends.quitFriends(function (err) { 104 friends.quitFriends(function (err) {
131 if (err) return next(err) 105 if (err) return next(err)