From c25d5432888694209d9bde3ba485f952290e8631 Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Thu, 21 Mar 2024 08:25:32 -0400 Subject: [PATCH] Fix endpoint for v3 zosmf route Signed-off-by: 1000TurquoisePogs --- WebContent/js/utilities/urlUtils.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/WebContent/js/utilities/urlUtils.js b/WebContent/js/utilities/urlUtils.js index 971eb710..5ce9abc3 100644 --- a/WebContent/js/utilities/urlUtils.js +++ b/WebContent/js/utilities/urlUtils.js @@ -20,6 +20,11 @@ export function whichServer() { return server; } +// zosmf/ +const ZOSMF_PREFIX_LENGTH=6; + export function atlasFetch(endpoint, content) { - return fetch(`https://${whichServer()}/ibmzosmf/api/v1/${endpoint}`, content); + // In v3, /ibmzosmf/api/v1 endpoint removes /zosmf part of a /zosmf URL, so string must be trimmed. + endpoint = endpoint.substring(ZOSMF_PREFIX_LENGTH); + return fetch(`https://${whichServer()}/ibmzosmf/api/v1/${endpoint}`, content); }