summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--routes/index.js8
-rw-r--r--views/data.jade1
2 files changed, 5 insertions, 4 deletions
diff --git a/routes/index.js b/routes/index.js
index fff06b6..8475824 100644
--- a/routes/index.js
+++ b/routes/index.js
@@ -117,15 +117,15 @@ exports.write = function(req, res) {
options.headers = {
'Content-Type': 'application/vnd.collection+json'
};
-// console.log('options', options);
+ // console.log('options', options);
-// console.log('params', extractParams(req.body));
var data = _.map(extractParams(req.body), function(value, key) {
return {name: key, value: value};
});
var body = {template: { data: data }};
-// console.log('body', JSON.stringify(body));
+ // console.log('body', JSON.stringify(body, null, ' '));
function done(message, httpResponse) {
+ // console.log('done', arguments);
var parsedBody;
try {
parsedBody = JSON.parse(httpResponse.body);
@@ -136,7 +136,7 @@ exports.write = function(req, res) {
root: collection_json.fromObject(parsedBody),
httpResponse: httpResponse,
parsedBody: parsedBody,
- rawBody: httpResponse.body
+ rawBody: typeof httpResponse == 'object' ? httpResponse.body : undefined,
});
}
var httpRequest = http.request(options, function(httpResponse) {
diff --git a/views/data.jade b/views/data.jade
index 13915cc..21a90c0 100644
--- a/views/data.jade
+++ b/views/data.jade
@@ -402,6 +402,7 @@ block inner_content
block content
- var collection = root.collection
+ - var params = params || {}
div(class='row-fluid')
div(class='span3')
block sidebar