Only append envKey if ENV_KEY is defined
Updated request logic to add the "envKey" query parameter only when the global ENV_KEY variable is defined. This prevents errors and avoids unnecessary parameters in requests when ENV_KEY is not set.
This commit is contained in:
@@ -15,7 +15,7 @@ const url = Object.freeze({
|
||||
//#region request helper methods
|
||||
function sendRequest(method, url, body = undefined) {
|
||||
const urlObj = new URL(url, window.location.origin);
|
||||
if (!urlObj.searchParams.has("envKey")) {
|
||||
if (typeof ENV_KEY !== 'undefined' && !urlObj.searchParams.has("envKey")) {
|
||||
urlObj.searchParams.set("envKey", ENV_KEY);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user