Skip to content
Snippets Groups Projects
Unverified Commit 2813fbc2 authored by Pawan Rawal's avatar Pawan Rawal
Browse files

UI: Bugfix, find and use the right key from the json response

parent 0e7e24f5
No related branches found
No related tags found
No related merge requests found
{
"main.css": "static/css/main.706f20fc.css",
"main.css.map": "static/css/main.706f20fc.css.map",
"main.js": "static/js/main.b4d5621d.js",
"main.js.map": "static/js/main.b4d5621d.js.map",
"main.js": "static/js/main.46af3d1c.js",
"main.js.map": "static/js/main.46af3d1c.js.map",
"static/media/glyphicons-halflings-regular.eot": "static/media/glyphicons-halflings-regular.f4769f9b.eot",
"static/media/glyphicons-halflings-regular.svg": "static/media/glyphicons-halflings-regular.89889688.svg",
"static/media/glyphicons-halflings-regular.ttf": "static/media/glyphicons-halflings-regular.e18bbf61.ttf",
......
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="shortcut icon" href="/favicon.ico"><title>Dgraph UI</title><link href="/static/css/main.706f20fc.css" rel="stylesheet"></head><body><div id="root"></div><script type="text/javascript" src="/static/js/main.b4d5621d.js"></script></body></html>
\ No newline at end of file
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="shortcut icon" href="/favicon.ico"><title>Dgraph UI</title><link href="/static/css/main.706f20fc.css" rel="stylesheet"></head><body><div id="root"></div><script type="text/javascript" src="/static/js/main.46af3d1c.js"></script></body></html>
\ No newline at end of file
source diff could not be displayed: it is too large. Options to address this: view the blob.
......@@ -471,6 +471,16 @@ function timeout(ms, promise) {
})
}
function getRootKey(response) {
let keys = Object.keys(response)
for(let i = 0; i < keys.length; i++) {
if(keys[i] != "server_latency" && keys[i] != "uids") {
return keys[i]
}
}
return ""
}
type QueryTs = {|
text: string,
lastRun: number
......@@ -638,7 +648,10 @@ class App extends React.Component {
}).then(checkStatus)
.then(parseJSON)
.then(function(result) {
var key = Object.keys(result)[0];
var key = getRootKey(result)
if(key === "") {
return;
}
if (result.code !== undefined && result.message !== undefined) {
that.storeQuery(that.state.query);
// This is the case in which user sends a mutation. We display the response from server.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment