added optional 'reverse' parameter to Posts.getPostsByTid and Topics.getTopicPosts (incoming signature adjustment for 0.4x)

This commit is contained in:
psychobunny
2014-02-13 15:21:24 -05:00
parent 1f8f65308b
commit fe2e86da81
2 changed files with 14 additions and 4 deletions

View File

@@ -306,8 +306,13 @@ var async = require('async'),
});
};
Topics.getTopicPosts = function(tid, start, end, current_user, callback) {
posts.getPostsByTid(tid, start, end, function(err, postData) {
Topics.getTopicPosts = function(tid, start, end, current_user, reverse, callback) {
if (typeof reverse === 'function') {
callback = reverse;
reverse = false;
}
posts.getPostsByTid(tid, start, end, reverse, function(err, postData) {
if(err) {
return callback(err);
}