aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--routes/index.js12
1 files changed, 0 insertions, 12 deletions
diff --git a/routes/index.js b/routes/index.js
index 0ecec65..5676d27 100644
--- a/routes/index.js
+++ b/routes/index.js
@@ -5,22 +5,12 @@ var collection_json = require('collection_json')
var now='2000-01-01';
function mapRow(row) {
- console.log('mapRow', row);
var data = _.map(row, function(value, key) {
return {name: key, value: value};
});
- console.log('mapRow', row, data);
return { data: data };
}
-function mapEmployee(row) {
- return {
- data: [
- {name: 'first_name', value: row.first_name}
- ]
- };
-}
-
exports.departments = function(req, res){
pg.connect(process.env.DATABASE_URL, function(err, client) {
if(err) throw err;
@@ -80,9 +70,7 @@ exports.employee = function(req, res){
client.end();
if(req.accepts('application/vnd.collection+json')) {
var items = [ mapRow(employee) ];
- console.log('items', items);
var object = collection_json.fromObject({collection: {items: items}});
- console.log('object', object);
res.contentType('application/vnd.collection+json');
res.send(JSON.stringify(object), 200);
}