From 3a71fde2b010ef50f5bd4a53455c090fb5e9afe8 Mon Sep 17 00:00:00 2001 From: Odei Maiz <33152403+odeimaiz@users.noreply.github.com> Date: Fri, 25 Oct 2024 13:20:54 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20[Frontend]=20Fix:=20Avoid=20null?= =?UTF-8?q?=20parameters=20in=20requests=20(#6601)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../client/source/class/osparc/data/Resources.js | 6 ++++++ .../class/osparc/desktop/organizations/OrganizationsList.js | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/services/static-webserver/client/source/class/osparc/data/Resources.js b/services/static-webserver/client/source/class/osparc/data/Resources.js index 9d591c0d1ee..5484107fd96 100644 --- a/services/static-webserver/client/source/class/osparc/data/Resources.js +++ b/services/static-webserver/client/source/class/osparc/data/Resources.js @@ -1249,6 +1249,12 @@ qx.Class.define("osparc.data.Resources", { * @param {Object} options Collections of options (pollTask, resolveWResponse, timeout, timeoutRetries) */ fetch: function(resource, endpoint, params = {}, options = {}) { + if (params === null) { + params = {}; + } + if (options === null) { + options = {}; + } return new Promise((resolve, reject) => { if (this.self().resources[resource] == null) { reject(Error(`Error while fetching ${resource}: the resource is not defined`)); diff --git a/services/static-webserver/client/source/class/osparc/desktop/organizations/OrganizationsList.js b/services/static-webserver/client/source/class/osparc/desktop/organizations/OrganizationsList.js index 935c9cfc35b..30797107583 100644 --- a/services/static-webserver/client/source/class/osparc/desktop/organizations/OrganizationsList.js +++ b/services/static-webserver/client/source/class/osparc/desktop/organizations/OrganizationsList.js @@ -180,7 +180,7 @@ qx.Class.define("osparc.desktop.organizations.OrganizationsList", { orgsModel.removeAll(); const useCache = false; - osparc.data.Resources.get("organizations", null, useCache) + osparc.data.Resources.get("organizations", {}, useCache) .then(async respOrgs => { const orgs = respOrgs["organizations"]; const promises = await orgs.map(async org => {