fixes to category pagination

This commit is contained in:
Baris Soner Usakli
2014-01-24 23:05:59 -05:00
parent ef6fd35e85
commit b23960e8d7
5 changed files with 22 additions and 8 deletions

View File

@@ -38,14 +38,15 @@ SocketCategories.loadPage = function(socket, data, callback) {
var start = (data.page - 1) * topicsPerPage,
end = start + topicsPerPage - 1;
console.log('start to end' ,start, end);
categories.getCategoryTopics(data.cid, start, end, socket.uid, function(err, topics) {
console.log('getting topics', topics.length);
callback(err, {
topics: topics
});
});
}
SocketCategories.getPageCount = function(socket, cid, callback) {
categories.getPageCount(cid, callback);
}
module.exports = SocketCategories;