From 2a5875fd408fbc80dc8eeb16327d61e606120c64 Mon Sep 17 00:00:00 2001 From: hosseintaromi Date: Mon, 21 Jul 2025 23:36:13 +0330 Subject: [PATCH] fix(utils): fix APIUrlGenerator undefined base URL issue - Replace import.meta.env.VITE_APP_BACKEND_BASE_URL with API_GATE_WAY constant - Ensure API URLs are generated correctly without undefined segments - Fix API endpoint URL construction --- src/utils/baseHttpService.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/utils/baseHttpService.ts b/src/utils/baseHttpService.ts index a4568de..a10b0f8 100644 --- a/src/utils/baseHttpService.ts +++ b/src/utils/baseHttpService.ts @@ -4,6 +4,7 @@ import { getAuth } from "@/pages/auth"; import { pageSize } from "@/constant/generalVariables"; import Cookies from "js-cookie"; import { postLogout } from "@/pages/auth/core/_requests"; + const baseURL = API_GATE_WAY; axios.defaults.baseURL = API_GATE_WAY; axios.defaults.timeout = REQUEST_TIMEOUT; @@ -149,9 +150,7 @@ export function APIUrlGenerator( ): string { const query = qry || {}; const queryKeys = Object.keys(query); - let apiUrl = `${ - baseUrl ? baseUrl : import.meta.env.VITE_APP_BACKEND_BASE_URL - }/${route}`; + let apiUrl = `${baseUrl || API_GATE_WAY}/${route}`; queryKeys.forEach((item, index) => { if (index === 0) { apiUrl += "?";