From 2603f2b47c3d89262b9fea9620c16d1324f9960f Mon Sep 17 00:00:00 2001 From: Soheel Chughtai Date: Fri, 25 Mar 2022 11:29:41 +0000 Subject: [PATCH] Add GetProject method --- services/discovery/discovery-utils2.js | 22 ++++++++++ services/discovery/v2-project-manager.html | 36 +++++++++++++++- services/discovery/v2-project-manager.js | 48 +++++++++++++++++----- 3 files changed, 93 insertions(+), 13 deletions(-) diff --git a/services/discovery/discovery-utils2.js b/services/discovery/discovery-utils2.js index c1a715c2..895d5120 100644 --- a/services/discovery/discovery-utils2.js +++ b/services/discovery/discovery-utils2.js @@ -44,10 +44,32 @@ DiscoveryUtils2.prototype = { }, + paramProjectCheck: function(params) { + var response = ''; + if (!params.projectId) { + response = 'Missing Project ID '; + } + return response; + }, + + buildParamsFor: function(msg, config, params, field) { + if (msg.discoveryparams && msg.discoveryparams[field]) { + params[field] = msg.discoveryparams[field]; + } else if (config[field]) { + params[field] = config[field]; + } + return params; + }, + + buildParams: function(msg, config) { var params = {}, me = this; + ['projectId'].forEach(function(f) { + params = me.buildParamsFor(msg, config, params, f); + }); + return params; } diff --git a/services/discovery/v2-project-manager.html b/services/discovery/v2-project-manager.html index 175a7d8e..885dd5d7 100644 --- a/services/discovery/v2-project-manager.html +++ b/services/discovery/v2-project-manager.html @@ -46,6 +46,12 @@ +
+ + +
+ +