From e673a058c995392b3ad6cbab91a9571bed29a57b Mon Sep 17 00:00:00 2001
From: Ashwin Sharma <ashwin.shyam.sharma@att.com>
Date: Thu, 30 Jul 2020 16:05:02 +0000
Subject: 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
---
 ui-react/src/api/LoopActionService.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'ui-react/src/api/LoopActionService.js')

diff --git a/ui-react/src/api/LoopActionService.js b/ui-react/src/api/LoopActionService.js
index 7cea3ff9..bff812a2 100644
--- a/ui-react/src/api/LoopActionService.js
+++ b/ui-react/src/api/LoopActionService.js
@@ -26,7 +26,7 @@ export default class LoopActionService{
 	static performAction(cl_name, uiAction) {
 		console.info("LoopActionService perform action: " + uiAction + " closedloopName=" + cl_name);
 		const svcAction = uiAction.toLowerCase();
- 		return fetch("/restservices/clds/v2/loop/" + svcAction + "/" + cl_name, {
+ 		return fetch(window.location.pathname + "restservices/clds/v2/loop/" + svcAction + "/" + cl_name, {
  				method: 'PUT',
  				credentials: 'same-origin'
  			})
@@ -51,7 +51,7 @@ export default class LoopActionService{
 	static refreshStatus(cl_name) {
 		console.info("Refresh the status for closedloopName=" + cl_name);
 
-		return fetch("/restservices/clds/v2/loop/getstatus/" + cl_name, {
+		return fetch(window.location.pathname + "restservices/clds/v2/loop/getstatus/" + cl_name, {
 			method: 'GET',
 			credentials: 'same-origin'
 		})
-- 
cgit