From 52693e66fe02451ad327ab10f5303aa3b8188506 Mon Sep 17 00:00:00 2001 From: sj895092 Date: Mon, 2 Dec 2024 14:29:33 +0100 Subject: [PATCH] removing the URLs changes Signed-off-by: sj895092 --- api-catalog-ui/frontend/src/helpers/urls.jsx | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/api-catalog-ui/frontend/src/helpers/urls.jsx b/api-catalog-ui/frontend/src/helpers/urls.jsx index 20aa88e497..2609495feb 100644 --- a/api-catalog-ui/frontend/src/helpers/urls.jsx +++ b/api-catalog-ui/frontend/src/helpers/urls.jsx @@ -24,16 +24,10 @@ const getBaseUrl = (pEnvironment, pLocation) => { // Going through the Gateway const urlParts = location.pathname.split('/'); - - if(urlParts[1]==="apicatalog") { - if (urlParts[2] === 'ui') { - return `${location.protocol}//${location.host}/${urlParts[1]}/api/${urlParts[3]}`; - } - } else { - if (urlParts[3] === 'ui') { - return `${location.protocol}//${location.host}/${urlParts[1]}${urlParts[2]}/api/${urlParts[4]}`; - } + if (urlParts[2] === 'ui') { + return `${location.protocol}//${location.host}/${urlParts[1]}/api/${urlParts[3]}`; } + // Testing environment if (environment.REACT_APP_GATEWAY_URL && environment.REACT_APP_CATALOG_HOME) { return `${environment.REACT_APP_GATEWAY_URL}${environment.REACT_APP_CATALOG_HOME}`; @@ -41,11 +35,9 @@ const getBaseUrl = (pEnvironment, pLocation) => { // Local development environment if (environment.REACT_APP_CATALOG_HOME) { - if(urlParts[1]!== "apicatalog") { - return `${location.protocol}//${location.host}/${urlParts[1]}${environment.REACT_APP_CATALOG_HOME}`; - } return `${location.protocol}//${location.host}${environment.REACT_APP_CATALOG_HOME}`; } + // Standalone access to the Catalog return location.href; };