diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-05-15 22:22:03 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-05-20 09:57:40 +0200 |
commit | 65fcc3119c334b75dd13bcfdebf186afdc580a8f (patch) | |
tree | 4f2158c61a9b7c3f47cfa233d01413b946ee53c0 /server/controllers/api/remote/pods.js | |
parent | d5f345ed4cfac4e1fa84dcb4fce1cda4d32f9c73 (diff) | |
download | PeerTube-65fcc3119c334b75dd13bcfdebf186afdc580a8f.tar.gz PeerTube-65fcc3119c334b75dd13bcfdebf186afdc580a8f.tar.zst PeerTube-65fcc3119c334b75dd13bcfdebf186afdc580a8f.zip |
First typescript iteration
Diffstat (limited to 'server/controllers/api/remote/pods.js')
-rw-r--r-- | server/controllers/api/remote/pods.js | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/server/controllers/api/remote/pods.js b/server/controllers/api/remote/pods.js deleted file mode 100644 index 0343bc62e..000000000 --- a/server/controllers/api/remote/pods.js +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | 'use strict' | ||
2 | |||
3 | const express = require('express') | ||
4 | const waterfall = require('async/waterfall') | ||
5 | |||
6 | const db = require('../../../initializers/database') | ||
7 | const middlewares = require('../../../middlewares') | ||
8 | const checkSignature = middlewares.secure.checkSignature | ||
9 | const signatureValidator = middlewares.validators.remote.signature | ||
10 | |||
11 | const router = express.Router() | ||
12 | |||
13 | // Post because this is a secured request | ||
14 | router.post('/remove', | ||
15 | signatureValidator.signature, | ||
16 | checkSignature, | ||
17 | removePods | ||
18 | ) | ||
19 | |||
20 | // --------------------------------------------------------------------------- | ||
21 | |||
22 | module.exports = router | ||
23 | |||
24 | // --------------------------------------------------------------------------- | ||
25 | |||
26 | function removePods (req, res, next) { | ||
27 | const host = req.body.signature.host | ||
28 | |||
29 | waterfall([ | ||
30 | function loadPod (callback) { | ||
31 | db.Pod.loadByHost(host, callback) | ||
32 | }, | ||
33 | |||
34 | function deletePod (pod, callback) { | ||
35 | pod.destroy().asCallback(callback) | ||
36 | } | ||
37 | ], function (err) { | ||
38 | if (err) return next(err) | ||
39 | |||
40 | return res.type('json').status(204).end() | ||
41 | }) | ||
42 | } | ||