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,8 +175,8 @@ function FoxxAdapter(nodes, edges, route, config) {
|
|||
|
||||
parseResult = function (result, callback) {
|
||||
var inserted = {},
|
||||
first = result.nodes[0];
|
||||
first = absAdapter.insertNode(first);
|
||||
first = result.first;
|
||||
first = absAdapter.insertNode(first);
|
||||
_.each(result.nodes, function(n) {
|
||||
n = absAdapter.insertNode(n);
|
||||
inserted[n._id] = n;
|
||||
|
|
|
@ -61,8 +61,14 @@
|
|||
break;
|
||||
case "GET":
|
||||
req.success({
|
||||
nodes: [{_id: 1}, {_id: 2}],
|
||||
edges: [{_id: "1-2", _from: 1, _to: 2}]
|
||||
first: {_id: 1},
|
||||
nodes: {
|
||||
"1": {_id: 1},
|
||||
"2": {_id: 2}
|
||||
},
|
||||
edges: {
|
||||
"1-2": {_id: "1-2", _from: 1, _to: 2}
|
||||
}
|
||||
});
|
||||
break;
|
||||
default:
|
||||
|
@ -261,8 +267,14 @@
|
|||
id = 1;
|
||||
spyOn($, "ajax").andCallFake(function(req) {
|
||||
req.success({
|
||||
nodes: [{_id: 1}, {_id: 2}],
|
||||
edges: [{_id: "1-2", _from: 1, _to: 2}]
|
||||
first: {_id: 1},
|
||||
nodes: {
|
||||
"1": {_id: 1},
|
||||
"2": {_id: 2}
|
||||
},
|
||||
edges: {
|
||||
"1-2": {_id: "1-2", _from: 1, _to: 2}
|
||||
}
|
||||
});
|
||||
});
|
||||
var callback = function() {
|
||||
|
|
Loading…
Reference in New Issue