aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/remote/pods.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-07-10 19:43:21 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-07-10 19:43:21 +0200
commit4771e0008dd26eadbb7eaff64255a6ec914fdadb (patch)
tree4fd58f8a3f3c2d674b936c99817b4f5fb958c5d8 /server/controllers/api/remote/pods.ts
parent7a214f746bf420defbf17fa218d90d6233551bf8 (diff)
downloadPeerTube-4771e0008dd26eadbb7eaff64255a6ec914fdadb.tar.gz
PeerTube-4771e0008dd26eadbb7eaff64255a6ec914fdadb.tar.zst
PeerTube-4771e0008dd26eadbb7eaff64255a6ec914fdadb.zip
Better typescript typing for a better world
Diffstat (limited to 'server/controllers/api/remote/pods.ts')
-rw-r--r--server/controllers/api/remote/pods.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/server/controllers/api/remote/pods.ts b/server/controllers/api/remote/pods.ts
index 6319957d3..69bbd4378 100644
--- a/server/controllers/api/remote/pods.ts
+++ b/server/controllers/api/remote/pods.ts
@@ -2,6 +2,7 @@ import * as express from 'express'
2 2
3import { database as db } from '../../../initializers/database' 3import { database as db } from '../../../initializers/database'
4import { checkSignature, signatureValidator } from '../../../middlewares' 4import { checkSignature, signatureValidator } from '../../../middlewares'
5import { PodSignature } from '../../../../shared'
5 6
6const remotePodsRouter = express.Router() 7const remotePodsRouter = express.Router()
7 8
@@ -21,12 +22,11 @@ export {
21// --------------------------------------------------------------------------- 22// ---------------------------------------------------------------------------
22 23
23function removePods (req: express.Request, res: express.Response, next: express.NextFunction) { 24function removePods (req: express.Request, res: express.Response, next: express.NextFunction) {
24 const host = req.body.signature.host 25 const signature: PodSignature = req.body.signature
26 const host = signature.host
25 27
26 db.Pod.loadByHost(host) 28 db.Pod.loadByHost(host)
27 .then(pod => { 29 .then(pod => pod.destroy())
28 return pod.destroy()
29 })
30 .then(() => res.type('json').status(204).end()) 30 .then(() => res.type('json').status(204).end())
31 .catch(err => next(err)) 31 .catch(err => next(err))
32} 32}