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:
2026-02-17 09:59:27 +01:00
parent 352618a745
commit a1a7f0eef7
2 changed files with 2 additions and 2 deletions

View File

@@ -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);
}