From 9816272b7b8293ce9607ec6e37b272880a194d2e Mon Sep 17 00:00:00 2001 From: Baris Usakli Date: Tue, 10 Dec 2013 15:02:22 -0500 Subject: [PATCH] if there are more than 50 results only return 50, issue #648 --- src/routes/api.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/routes/api.js b/src/routes/api.js index 0ba2af2a44..46e0069ad3 100644 --- a/src/routes/api.js +++ b/src/routes/api.js @@ -237,6 +237,10 @@ var path = require('path'), return callback(err, null); } + if(pids.length > 50) { + pids = pids.splice(0, 50); + } + posts.getPostSummaryByPids(pids, false, function (err, posts) { if (err){ return callback(err, null); @@ -252,6 +256,10 @@ var path = require('path'), return callback(err, null); } + if(tids.length > 50) { + tids = tids.splice(0, 50); + } + topics.getTopicsByTids(tids, 0, function (topics) { callback(null, topics); }, 0);