aboutsummaryrefslogtreecommitdiffstats
path: root/routes
diff options
context:
space:
mode:
Diffstat (limited to 'routes')
-rw-r--r--routes/users.js15
1 files changed, 9 insertions, 6 deletions
diff --git a/routes/users.js b/routes/users.js
index 50db4ec5..2e94f027 100644
--- a/routes/users.js
+++ b/routes/users.js
@@ -18,13 +18,16 @@
});
},
json: function(req, res) {
- return db.hgetall("user:" + req.params.user, function(err, obj) {
- delete obj['password'];
- res.writeHead(200, {
- "Content-Type": "application/json"
+ return db.llen("" + req.params.user + ":transactions", function(err, len) {
+ return db.hgetall("user:" + req.params.user, function(err, obj) {
+ delete obj['password'];
+ obj['index'] = len;
+ res.writeHead(200, {
+ "Content-Type": "application/json"
+ });
+ res.write(JSON.stringify(obj));
+ return res.end();
});
- res.write(JSON.stringify(obj));
- return res.end();
});
},
show: function(req, res) {