diff options
author | Ashwin Sharma <ashwin.shyam.sharma@att.com> | 2020-07-30 16:05:02 +0000 |
---|---|---|
committer | Ashwin Sharma <ashwin.shyam.sharma@att.com> | 2020-07-30 16:05:02 +0000 |
commit | e673a058c995392b3ad6cbab91a9571bed29a57b (patch) | |
tree | b9454b4ec885c25f628d03b137ccb94d8a83d9f7 /ui-react/src/api/PolicyToscaService.js | |
parent | a7f63adca6933886bd3499044ae93c0daa01705c (diff) |
Clamp react ui to use url pathname dynamically instead of hardcoded prefix for calling apis
Issue-ID: CLAMP-914
Signed-off-by: Ashwin Sharma <ashwin.shyam.sharma@att.com>
Change-Id: I266aeafe9a543e95bcb96fcab6437227c148f8c4
Diffstat (limited to 'ui-react/src/api/PolicyToscaService.js')
-rw-r--r-- | ui-react/src/api/PolicyToscaService.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ui-react/src/api/PolicyToscaService.js b/ui-react/src/api/PolicyToscaService.js index 610a11418..a7bc140b6 100644 --- a/ui-react/src/api/PolicyToscaService.js +++ b/ui-react/src/api/PolicyToscaService.js @@ -22,7 +22,7 @@ export default class PolicyToscaService { static getToscaPolicyModels() { - return fetch('restservices/clds/v2/policyToscaModels', { method: 'GET', credentials: 'same-origin' }) + return fetch(window.location.pathname + 'restservices/clds/v2/policyToscaModels', { method: 'GET', credentials: 'same-origin' }) .then(function (response) { console.debug("getToscaPolicyModels response received: ", response.status); if (response.ok) { @@ -39,7 +39,7 @@ export default class PolicyToscaService { } static getToscaPolicyModelYaml(policyModelType, policyModelVersion) { - return fetch('/restservices/clds/v2/policyToscaModels/yaml/' + policyModelType + "/" + policyModelVersion, { + return fetch(window.location.pathname + 'restservices/clds/v2/policyToscaModels/yaml/' + policyModelType + "/" + policyModelVersion, { method: 'GET', credentials: 'same-origin' }) @@ -59,7 +59,7 @@ export default class PolicyToscaService { } static getToscaPolicyModel(policyModelType, policyModelVersion) { - return fetch('/restservices/clds/v2/policyToscaModels/' + policyModelType + "/" + policyModelVersion, { + return fetch(window.location.pathname + 'restservices/clds/v2/policyToscaModels/' + policyModelType + "/" + policyModelVersion, { method: 'GET', credentials: 'same-origin' }) @@ -79,7 +79,7 @@ export default class PolicyToscaService { } static createPolicyModelFromToscaModel(jsonData) { - return fetch('/restservices/clds/v2/policyToscaModels', { + return fetch(window.location.pathname + 'restservices/clds/v2/policyToscaModels', { method: 'POST', credentials: 'same-origin', headers: { @@ -107,7 +107,7 @@ export default class PolicyToscaService { } static updatePolicyModelTosca(policyModelType, policyModelVersion, jsonData) { - return fetch('/restservices/clds/v2/policyToscaModels/' + policyModelType + '/' + policyModelVersion, { + return fetch(window.location.pathname + 'restservices/clds/v2/policyToscaModels/' + policyModelType + '/' + policyModelVersion, { method: 'PUT', credentials: 'same-origin', headers: { |