Commit ec6004f4 authored by Sven Franck's avatar Sven Franck

fixed network API to generate query objects correctly

parent cd773165
......@@ -6,7 +6,6 @@
"form": true,
"id": "network_overview",
"property_dict": {
"initial_query_url_identifier": "reference",
"dynamic_children": [2],
"requires_authentication": true,
"depends_on": "login_state",
......@@ -26,7 +25,7 @@
},
"feature_dict": {
"linkable": true,
"link_identifier": "reference"
"link_identifier": "_id"
}
},
"children": [{
......
......@@ -6,6 +6,7 @@
"form": true,
"id": "network_view",
"property_dict": {
"initial_query_url_identifier": "_id",
"dynamic_children": [0],
"requires_authentication": true,
"depends_on": "login_state",
......
......@@ -3980,7 +3980,7 @@
* @return {object} "allDocs" response object
**/
storage.mapResponse = function (response, convert) {
var answer, i, record, key, data, pushit;
var answer, i, record, key, data, pushit, value_dict;
answer = {"data": {"total_rows": null, "rows": []}};
pushit = function (obj, record_id) {
......@@ -3999,13 +3999,16 @@
answer.data.total_rows = response.data.total_rows;
for (i = 0; i < response.data.total_rows; i += 1) {
data = {};
record = response.data.rows[i].value;
for (key in record) {
if (record.hasOwnProperty(key)) {
data[key] = record[key];
record = response.data.rows[i];
value_dict = record.value;
for (key in value_dict) {
if (value_dict.hasOwnProperty(key)) {
data[key] = value_dict[key];
}
}
answer.data.rows.push(pushit(data));
// TODO: verfiy this is valid!
data["_id"] = record.id;
answer.data.rows.push(pushit(data, record.id));
}
}
return answer;
......@@ -5965,7 +5968,6 @@
return storage[parcel.storage][method || "allDocs"](parcel.query)
.then(function (response) {
// TODO: best way?
if (convert !== undefined && response.status === 200) {
return {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment