aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/remote/pods.ts
diff options
context:
space:
mode:
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}