1 import express = require('express')
2 import { waterfall } from 'async/waterfall'
4 const db = require('../../../initializers/database')
5 import { checkSignature, signatureValidator } from '../../../middlewares'
7 const remotePodsRouter = express.Router()
9 // Post because this is a secured request
10 remotePodsRouter.post('/remove',
16 // ---------------------------------------------------------------------------
22 // ---------------------------------------------------------------------------
24 function removePods (req, res, next) {
25 const host = req.body.signature.host
28 function loadPod (callback) {
29 db.Pod.loadByHost(host, callback)
32 function deletePod (pod, callback) {
33 pod.destroy().asCallback(callback)
36 if (err) return next(err)
38 return res.type('json').status(204).end()