added infinite load to user favourites page

This commit is contained in:
Baris Soner Usakli
2014-02-03 19:24:27 -05:00
parent d53480015b
commit c7195290c8
5 changed files with 103 additions and 26 deletions

View File

@@ -247,4 +247,15 @@ SocketPosts.flag = function(socket, pid, callback) {
], callback);
}
SocketPosts.loadMoreFavourites = function(socket, data, callback) {
if(!data || !data.after) {
return callback(new Error('invalid data'));
}
var start = parseInt(data.after, 10),
end = start + 9;
posts.getFavourites(socket.uid, start, end, callback);
};
module.exports = SocketPosts;