Skip to content

Commit

Permalink
fix: getBackendUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
m-abe-dev committed Sep 30, 2024
1 parent 7ac8608 commit 7a75335
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions web/src/services/api/projectApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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) {
Expand Down

0 comments on commit 7a75335

Please sign in to comment.