aboutsummaryrefslogtreecommitdiffstats
path: root/gui-editors/gui-editor-apex/src/main/resources/webapp
diff options
context:
space:
mode:
authorandre.schmid <andre.schmid@est.tech>2021-10-27 19:01:30 +0100
committerLiam Fallon <liam.fallon@est.tech>2021-10-29 14:26:03 +0000
commit039b52132eff507ed8bc305efacf13e6bde3cd8f (patch)
tree22004923887ec8fc79281e17218618e356dc57cd /gui-editors/gui-editor-apex/src/main/resources/webapp
parentc3b54346bf55de9f5cd83ec1840b9af89dbda467 (diff)
Add user id only when it was provided
During the policy upload call, the user id is being added as a query parameter even if it was not provided, causing to provide the value "null" as the userId parameter. This change just add the userId to the call when it is available. Issue-ID: POLICY-3796 Signed-off-by: andre.schmid <andre.schmid@est.tech> Change-Id: I7bcc928f1ca144ee1ad05e7d1028ea08a15ebd42 (cherry picked from commit 08b6e0e63e4524d02507d6709710b53f87690cc0)
Diffstat (limited to 'gui-editors/gui-editor-apex/src/main/resources/webapp')
-rw-r--r--gui-editors/gui-editor-apex/src/main/resources/webapp/js/ApexFiles.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/gui-editors/gui-editor-apex/src/main/resources/webapp/js/ApexFiles.js b/gui-editors/gui-editor-apex/src/main/resources/webapp/js/ApexFiles.js
index a002788..de9edf3 100644
--- a/gui-editors/gui-editor-apex/src/main/resources/webapp/js/ApexFiles.js
+++ b/gui-editors/gui-editor-apex/src/main/resources/webapp/js/ApexFiles.js
@@ -58,10 +58,13 @@ function files_fileDownload() {
}
function files_fileUpload() {
- var requestURL = window.restRootURL + "/Model/Upload?userId=" + new URLSearchParams(window.location.search).get('userId');
-
+ let requestURL = window.restRootURL + "/Model/Upload";
+ const userId = new URLSearchParams(window.location.search).get('userId');
+ if (userId) {
+ requestURL = requestURL + "?userId=" + userId;
+ }
ajax_getOKOrFail(requestURL, function(data) {
- var uploadResultString = "";
+ let uploadResultString = "";
for (let value of data.messages.message) {
uploadResultString += (value + "\n");
}