From 7a753358f7e7ca877200d6be836d63ba1c385d2c Mon Sep 17 00:00:00 2001 From: m-abe-dev Date: Tue, 1 Oct 2024 00:14:44 +0200 Subject: [PATCH] fix: getBackendUrl --- web/src/services/api/projectApi.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/web/src/services/api/projectApi.ts b/web/src/services/api/projectApi.ts index f0da4ccc1e..d99797aa82 100644 --- a/web/src/services/api/projectApi.ts +++ b/web/src/services/api/projectApi.ts @@ -393,7 +393,11 @@ export default () => { const getBackendUrl = useCallback(() => { const apiUrl = window.REEARTH_CONFIG?.api; - return apiUrl?.replace(/\/api$/, ""); + if (apiUrl && !apiUrl.includes("localhost")) { + return apiUrl.replace(/\/api$/, ""); + } else { + return window.REEARTH_CONFIG?.auth0Audience; + } }, []); const useExportProject = useCallback( @@ -419,7 +423,6 @@ export default () => { const backendUrl = getBackendUrl(); const downloadUrl = `${backendUrl}${projectDataPath}`; - console.log("downloadUrl", downloadUrl); const response = await fetch(downloadUrl); if (!response.ok) {