diff --git a/packages/cp-frontend/src/graphql/DeploymentGroupDeleteMutation.gql b/packages/cp-frontend/src/graphql/DeploymentGroupDeleteMutation.gql index 83d228c9..fd255166 100644 --- a/packages/cp-frontend/src/graphql/DeploymentGroupDeleteMutation.gql +++ b/packages/cp-frontend/src/graphql/DeploymentGroupDeleteMutation.gql @@ -1,7 +1,5 @@ -#import "./DeploymentGroupInfo.gql" - mutation DeleteDeploymentGroup($id: ID!) { deleteDeploymentGroup(id: $id) { - ...DeploymentGroupInfo + id } } diff --git a/packages/portal-api/lib/data/index.js b/packages/portal-api/lib/data/index.js index a099f2aa..e62846e5 100644 --- a/packages/portal-api/lib/data/index.js +++ b/packages/portal-api/lib/data/index.js @@ -466,6 +466,10 @@ class Data extends EventEmitter { return cb(err); } + if (!deploymentGroup) { + return cb(null); + } + cb(null, Transform.fromDeploymentGroup(this._getDeploymentGroupFns(deploymentGroup))); }); } @@ -545,7 +549,9 @@ class Data extends EventEmitter { }, next); } ] - }, cb); + }, (err) => { + cb(err, res.dg); + }); }; VAsync.parallel({ @@ -695,7 +701,21 @@ class Data extends EventEmitter { return finish(err); } - this._db.versions.get(deploymentGroup.history, finish); + if (!deploymentGroup) { + return finish(null, []); + } + + deploymentGroup.history({}, (err, history) => { + if (err) { + return finish(err); + } + + if (!history.length) { + return finish(null, []); + } + + this._db.versions.get(deploymentGroup.history.map(({ id }) => { return { id }; }), finish); + }); }); }); }