diff --git a/lib/routes/docker-compose-cluster.js b/lib/routes/docker-compose-cluster.js index 608924210..bafa4926a 100644 --- a/lib/routes/docker-compose-cluster.js +++ b/lib/routes/docker-compose-cluster.js @@ -47,12 +47,6 @@ const redeploySchema = joi.object({ instanceId: joi.string().required() }).unknown().required() -const multiDeleteSchema = joi.object({ - cluster: joi.object({ - id: joi.string().required() - }).required().unknown() -}).unknown().required() - function makeCreateOptsFromBody (sessionUser, body, mainInstanceServiceName) { const repoFullName = keypather.get(body, 'repo') const branchName = keypather.get(body, 'branch') @@ -239,17 +233,13 @@ function multiCreateRoute (req, res, next) { } const multiDeleteRoute = function (req, res, next) { - const clusterId = keypather.get(req, 'body.cluster.id') + const clusterId = keypather.get(req, 'params.id') const log = logger.child({ method: 'multiDeleteRoute', clusterId }) log.info('called') - return joi.validateOrBoomAsync(req.body, multiDeleteSchema) - .tap(() => { - log.trace('delete all clusters') - return ClusterConfigService.deleteAllICC(clusterId) - }) + return ClusterConfigService.deleteAllICC(clusterId) .then(() => { const message = 'cluster.delete.multi job enqueued' return { json: { message }, status: 202 } @@ -280,7 +270,7 @@ app.post('/docker-compose-cluster/multi', multiCreateRoute) app.post('/docker-compose-cluster/', postRoute) app.delete('/docker-compose-cluster/', deleteRoute) app.post('/docker-compose-cluster/redeploy/', redeployRoute) -app.delete('/docker-compose-cluster/multi/', multiDeleteRoute) +app.delete('/docker-compose-cluster/:id/multi/', multiDeleteRoute) app.get('/docker-compose-cluster/:id/related', multiFetchRoute) module.exports = app