mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-29 01:56:12 +01:00
change getRecentPosts to take count
This commit is contained in:
@@ -296,8 +296,12 @@ SocketPosts.loadMoreUserPosts = function(socket, data, callback) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
SocketPosts.getRecentPosts = function(socket, term, callback) {
|
SocketPosts.getRecentPosts = function(socket, data, callback) {
|
||||||
posts.getRecentPosts(socket.uid, 0, 19, term, callback);
|
if(!data || !data.count) {
|
||||||
|
return callback(new Error('invalid data'));
|
||||||
|
}
|
||||||
|
|
||||||
|
posts.getRecentPosts(socket.uid, 0, data.count - 1, data.term, callback);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user