diff --git a/apps/edr-freight-web/backoffice/src/performance-management/services/api/metabaseService.ts b/apps/edr-freight-web/backoffice/src/performance-management/services/api/metabaseService.ts index 34e4212fb..2b5636ce2 100644 --- a/apps/edr-freight-web/backoffice/src/performance-management/services/api/metabaseService.ts +++ b/apps/edr-freight-web/backoffice/src/performance-management/services/api/metabaseService.ts @@ -49,7 +49,7 @@ export interface GetIframeUrlRequest { // Create a dedicated axios instance for Metabase API const metabaseAxios = axios.create({ - baseURL: getEnvUrl("VITE_CHRONICLE_URL"), + baseURL: getEnvUrl("VITE_CHRONICLE_URL", false), }); // Add auth token interceptor diff --git a/apps/edr-freight-web/backoffice/src/shared/config/app.config.ts b/apps/edr-freight-web/backoffice/src/shared/config/app.config.ts index 335eb4539..becf016ba 100644 --- a/apps/edr-freight-web/backoffice/src/shared/config/app.config.ts +++ b/apps/edr-freight-web/backoffice/src/shared/config/app.config.ts @@ -9,5 +9,3 @@ function normalizeBaseUrl(url: string) { export const AUDITLOG_API_URL: string = normalizeBaseUrl( getEnvUrl("VITE_AUDITLOG_API_URL", false), ); - -if (!AUDITLOG_API_URL) console.warn("Missing VITE_AUDITLOG_API_URL"); diff --git a/apps/edr-freight-web/backoffice/src/shared/services/chronicleInstance.ts b/apps/edr-freight-web/backoffice/src/shared/services/chronicleInstance.ts index 740b95990..773619dea 100644 --- a/apps/edr-freight-web/backoffice/src/shared/services/chronicleInstance.ts +++ b/apps/edr-freight-web/backoffice/src/shared/services/chronicleInstance.ts @@ -9,18 +9,12 @@ import { } from "../utils/authPersistence"; import { handleSessionExpiry } from "./sessionExpiry"; -if (!import.meta.env.VITE_CHRONICLE_URL) { - console.warn("Missing VITE_CHRONICLE_URL — chronicle axios instance has no base URL"); -} - +// Chronicle/audit-log backend is optional in this deployment — no warning +// when unset; the module's screens are simply non-functional without it. const chronicleBaseUrl = getEnvUrl("VITE_CHRONICLE_URL", false) || getEnvUrl("VITE_AUDITLOG_API_URL", false); -if (!chronicleBaseUrl) { - console.warn("Missing VITE_CHRONICLE_URL and VITE_AUDITLOG_API_URL"); -} - const chronicleInstance = axios.create({ baseURL: chronicleBaseUrl, }); diff --git a/apps/edr-freight-web/backoffice/src/shared/services/recordAxiosInstance.ts b/apps/edr-freight-web/backoffice/src/shared/services/recordAxiosInstance.ts index d1f476c0c..38c770031 100644 --- a/apps/edr-freight-web/backoffice/src/shared/services/recordAxiosInstance.ts +++ b/apps/edr-freight-web/backoffice/src/shared/services/recordAxiosInstance.ts @@ -8,14 +8,10 @@ import { } from "../utils/authPersistence"; import { handleSessionExpiry } from "./sessionExpiry"; -if (!import.meta.env.VITE_RECORD_API_URL) { - console.warn( - "Missing VITE_RECORD_API_URL — record axios instance has no base URL", - ); -} - +// Record backend is optional in this deployment — no warning when unset; the +// module's screens are simply non-functional without it. const recordAxiosInstance = axios.create({ - baseURL: getEnvUrl("VITE_RECORD_API_URL"), + baseURL: getEnvUrl("VITE_RECORD_API_URL", false), }); // Attach auth token and CSRF defence header to every request diff --git a/apps/edr-freight-web/backoffice/src/user-management/web-Management/TemplateSettingValues/services/templateSettingValueService.ts b/apps/edr-freight-web/backoffice/src/user-management/web-Management/TemplateSettingValues/services/templateSettingValueService.ts index 78719b412..fbb3c7739 100644 --- a/apps/edr-freight-web/backoffice/src/user-management/web-Management/TemplateSettingValues/services/templateSettingValueService.ts +++ b/apps/edr-freight-web/backoffice/src/user-management/web-Management/TemplateSettingValues/services/templateSettingValueService.ts @@ -8,7 +8,7 @@ import Cookies from "js-cookie"; import { getEnvUrl } from "@/shared/config/env"; const TENANT_ID = "adf98293-41ba-4bda-bdb4-70e30a70c1b7"; -const API_URL = getEnvUrl("VITE_RECORD_API_URL"); +const API_URL = getEnvUrl("VITE_RECORD_API_URL", false); const apiInstance = axios.create({ baseURL: API_URL, diff --git a/apps/edr-freight-web/backoffice/src/user-management/web-Management/services/templateService.ts b/apps/edr-freight-web/backoffice/src/user-management/web-Management/services/templateService.ts index fdaa54197..35d4ed036 100644 --- a/apps/edr-freight-web/backoffice/src/user-management/web-Management/services/templateService.ts +++ b/apps/edr-freight-web/backoffice/src/user-management/web-Management/services/templateService.ts @@ -11,7 +11,7 @@ import Cookies from "js-cookie"; import { getEnvUrl } from "@/shared/config/env"; const TENANT_ID = "adf98293-41ba-4bda-bdb4-70e30a70c1b7"; -const API_URL = getEnvUrl("VITE_RECORD_API_URL"); +const API_URL = getEnvUrl("VITE_RECORD_API_URL", false); // Create axios instance for template API const apiInstance = axios.create({