diff --git a/js/apps/system/aardvark/aardvark.js b/js/apps/system/aardvark/aardvark.js index fca0da4914..131176f317 100644 --- a/js/apps/system/aardvark/aardvark.js +++ b/js/apps/system/aardvark/aardvark.js @@ -407,7 +407,8 @@ controller.get("/query/download/:user", function(req, res) { res.set("Content-Type", "application/json"); res.set("Content-Disposition", "attachment; filename=queries.json"); - res.json(result.extra.queries); + + res.json(result.userData.queries); }).summary("Download all user queries") .notes("This function downloads all user queries from the given user"); @@ -424,7 +425,6 @@ controller.get("/query/result/download/:query", function(req, res) { var internal = require("internal"); query = internal.base64Decode(query); -internal.print(query); try { parsedQuery = JSON.parse(query); } diff --git a/js/apps/system/aardvark/frontend/js/views/queryView.js b/js/apps/system/aardvark/frontend/js/views/queryView.js index bc31a30f73..2196b542b2 100644 --- a/js/apps/system/aardvark/frontend/js/views/queryView.js +++ b/js/apps/system/aardvark/frontend/js/views/queryView.js @@ -298,7 +298,7 @@ var inputEditor = ace.edit("aqlEditor"); var query = inputEditor.getValue(); if (query !== '' || query !== undefined || query !== null) { - window.open(encodeURI("query/result/download/" + btoa(JSON.stringify({ query: query })))); + window.open("query/result/download/" + encodeURIComponent(btoa(JSON.stringify({ query: query })))); } else { arangoHelper.arangoError("Query error", "could not query result."); @@ -326,7 +326,7 @@ }); - window.open(encodeURI("query/download/" + name)); + window.open("query/download/" + encodeURIComponent(name)); }, deselect: function (editor) {