diff options
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 | } |