From 3aa88141d46ff2b16c7c1217fee447765849d907 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81rgio=20Ramos?= Date: Wed, 28 Jun 2017 00:11:19 +0100 Subject: [PATCH] feat(portal-data): use internals.resolveCb --- packages/portal-data/lib/index.js | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/packages/portal-data/lib/index.js b/packages/portal-data/lib/index.js index f7aa94f1..dba5935a 100644 --- a/packages/portal-data/lib/index.js +++ b/packages/portal-data/lib/index.js @@ -260,7 +260,7 @@ module.exports = class Data extends EventEmitter { args.deploymentGroupId = deploymentGroup.id; return new Promise((resolve, reject) => { - this.getServices(args, resolveCb(resolve, reject)); + this.getServices(args, internals.resolveCb(resolve, reject)); }); }; @@ -270,7 +270,7 @@ module.exports = class Data extends EventEmitter { return new Promise((resolve, reject) => { return deploymentGroup.version_id ? - this.getVersion(args, resolveCb(resolve, reject)) : + this.getVersion(args, internals.resolveCb(resolve, reject)) : resolve(null); }); }; @@ -291,17 +291,6 @@ module.exports = class Data extends EventEmitter { return cb(null, []); } - const getServices = (deploymentGroupId) => { - return (args) => { - args = args || {}; - args.deploymentGroupId = deploymentGroupId; - - return new Promise((resolve, reject) => { - this.getServices(args, internals.resolveCb(resolve, reject)); - }); - }; - }; - // todo getHistory cb(null, deploymentGroups.map((dg) => { return Transform.fromDeploymentGroup(this._getDeploymentGroupVersion(dg)); })); @@ -346,7 +335,7 @@ module.exports = class Data extends EventEmitter { return new Promise((resolve, reject) => { return this.getManifest({ id: version.manifest_id - }, resolveCb(resolve, reject)); + }, internals.resolveCb(resolve, reject)); }); } });