From a5a2c047b034a3616415854d58d25be19a43bd58 Mon Sep 17 00:00:00 2001 From: Laurence Maultsby Date: Wed, 14 Sep 2016 12:45:20 -0400 Subject: [PATCH] Account and Instantiate fix for when RO account api is 204 Signed-off-by: Laurence Maultsby --- .../plugins/accounts/src/account/accountSource.js | 12 +++++++++--- .../src/instantiate/launchNetworkServiceSource.js | 8 +++++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/skyquake/plugins/accounts/src/account/accountSource.js b/skyquake/plugins/accounts/src/account/accountSource.js index c2aa4d495..45067247a 100644 --- a/skyquake/plugins/accounts/src/account/accountSource.js +++ b/skyquake/plugins/accounts/src/account/accountSource.js @@ -41,7 +41,7 @@ module.exports = function(Alt) { type: 'POST', beforeSend: Utils.addAuthorizationStub, data: { - url:window.location.protocol + '//' + window.location.host + '/accounts/all?api_server=' + API_SERVER + url:window.location.protocol + '//' + window.location.host + '/accounts/all?api_server=' + API_SERVER }, success: function(data, textStatus, jqXHR) { Utils.checkAndResolveSocketRequest(data, resolve, reject); @@ -222,7 +222,13 @@ module.exports = function(Alt) { beforeSend: Utils.addAuthorizationStub, contentType: "application/json", success: function(data) { - resolve(data["rw-launchpad:resource-orchestrator"]); + let returnedData; + if (data.hasOwnProperty("rw-launchpad:resource-orchestrator")) { + returnedData = data; + } else { + returnedData = {}; + } + resolve(returnedData); }, error: function(error) { console.log("There was an error updating the account: ", arguments); @@ -239,7 +245,7 @@ module.exports = function(Alt) { 'error': 'There was an error retrieving the resource orchestrator information.' }), success: Alt.actions.global.getResourceOrchestratorSuccess, - loading: Alt.actions.global.showScreenLoader, + loading: Alt.actions.global.showScreenLoader, error: Alt.actions.global.showNotification }, } diff --git a/skyquake/plugins/launchpad/src/instantiate/launchNetworkServiceSource.js b/skyquake/plugins/launchpad/src/instantiate/launchNetworkServiceSource.js index 3a8886cef..5bd34434d 100644 --- a/skyquake/plugins/launchpad/src/instantiate/launchNetworkServiceSource.js +++ b/skyquake/plugins/launchpad/src/instantiate/launchNetworkServiceSource.js @@ -200,7 +200,13 @@ export default function(Alt){ beforeSend: Utils.addAuthorizationStub, contentType: "application/json", success: function(data) { - resolve(data["rw-launchpad:resource-orchestrator"]); + let returnedData; + if (data.hasOwnProperty("rw-launchpad:resource-orchestrator")) { + returnedData = data; + } else { + returnedData = {}; + } + resolve(returnedData); }, error: function(error) { console.log("There was an error updating the account: ", arguments); -- 2.25.1