mirror of https://gitee.com/bigwinds/arangodb
GraphViewer: Changed accepted format of FoxxAdapter from Array to Object where it is much easier to identify equal nodes on server side
This commit is contained in:
parent
60b540b231
commit
7ea3a30f68
|
@ -175,7 +175,7 @@ function FoxxAdapter(nodes, edges, route, config) {
|
||||||
|
|
||||||
parseResult = function (result, callback) {
|
parseResult = function (result, callback) {
|
||||||
var inserted = {},
|
var inserted = {},
|
||||||
first = result.nodes[0];
|
first = result.first;
|
||||||
first = absAdapter.insertNode(first);
|
first = absAdapter.insertNode(first);
|
||||||
_.each(result.nodes, function(n) {
|
_.each(result.nodes, function(n) {
|
||||||
n = absAdapter.insertNode(n);
|
n = absAdapter.insertNode(n);
|
||||||
|
|
|
@ -61,8 +61,14 @@
|
||||||
break;
|
break;
|
||||||
case "GET":
|
case "GET":
|
||||||
req.success({
|
req.success({
|
||||||
nodes: [{_id: 1}, {_id: 2}],
|
first: {_id: 1},
|
||||||
edges: [{_id: "1-2", _from: 1, _to: 2}]
|
nodes: {
|
||||||
|
"1": {_id: 1},
|
||||||
|
"2": {_id: 2}
|
||||||
|
},
|
||||||
|
edges: {
|
||||||
|
"1-2": {_id: "1-2", _from: 1, _to: 2}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -261,8 +267,14 @@
|
||||||
id = 1;
|
id = 1;
|
||||||
spyOn($, "ajax").andCallFake(function(req) {
|
spyOn($, "ajax").andCallFake(function(req) {
|
||||||
req.success({
|
req.success({
|
||||||
nodes: [{_id: 1}, {_id: 2}],
|
first: {_id: 1},
|
||||||
edges: [{_id: "1-2", _from: 1, _to: 2}]
|
nodes: {
|
||||||
|
"1": {_id: 1},
|
||||||
|
"2": {_id: 2}
|
||||||
|
},
|
||||||
|
edges: {
|
||||||
|
"1-2": {_id: "1-2", _from: 1, _to: 2}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
var callback = function() {
|
var callback = function() {
|
||||||
|
|
Loading…
Reference in New Issue