diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-07-10 19:43:21 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-07-10 19:43:21 +0200 |
commit | 4771e0008dd26eadbb7eaff64255a6ec914fdadb (patch) | |
tree | 4fd58f8a3f3c2d674b936c99817b4f5fb958c5d8 /server/controllers/api/remote/pods.ts | |
parent | 7a214f746bf420defbf17fa218d90d6233551bf8 (diff) | |
download | PeerTube-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.ts | 8 |
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 | ||
3 | import { database as db } from '../../../initializers/database' | 3 | import { database as db } from '../../../initializers/database' |
4 | import { checkSignature, signatureValidator } from '../../../middlewares' | 4 | import { checkSignature, signatureValidator } from '../../../middlewares' |
5 | import { PodSignature } from '../../../../shared' | ||
5 | 6 | ||
6 | const remotePodsRouter = express.Router() | 7 | const remotePodsRouter = express.Router() |
7 | 8 | ||
@@ -21,12 +22,11 @@ export { | |||
21 | // --------------------------------------------------------------------------- | 22 | // --------------------------------------------------------------------------- |
22 | 23 | ||
23 | function removePods (req: express.Request, res: express.Response, next: express.NextFunction) { | 24 | function 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 | } |