mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-30 18:46:01 +01:00
remove unused methods
This commit is contained in:
@@ -66,24 +66,6 @@ Categories.isIgnored = function (cids, uid, callback) {
|
||||
db.isSortedSetMembers('uid:' + uid + ':ignored:cids', cids, callback);
|
||||
};
|
||||
|
||||
Categories.getPageCount = function (cid, uid, callback) {
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
async.parallel({
|
||||
topicCount: async.apply(Categories.getCategoryField, cid, 'topic_count'),
|
||||
settings: async.apply(user.getSettings, uid),
|
||||
}, next);
|
||||
},
|
||||
function (results, next) {
|
||||
if (!parseInt(results.topicCount, 10)) {
|
||||
return next(null, 1);
|
||||
}
|
||||
|
||||
next(null, Math.ceil(parseInt(results.topicCount, 10) / results.settings.topicsPerPage));
|
||||
},
|
||||
], callback);
|
||||
};
|
||||
|
||||
Categories.getAllCategories = function (uid, callback) {
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
|
||||
@@ -123,10 +123,6 @@ SocketCategories.loadMore = function (socket, data, callback) {
|
||||
], callback);
|
||||
};
|
||||
|
||||
SocketCategories.getPageCount = function (socket, cid, callback) {
|
||||
categories.getPageCount(cid, socket.uid, callback);
|
||||
};
|
||||
|
||||
SocketCategories.getTopicCount = function (socket, cid, callback) {
|
||||
categories.getCategoryField(cid, 'topic_count', callback);
|
||||
};
|
||||
|
||||
@@ -37,25 +37,6 @@ Topics.exists = function (tid, callback) {
|
||||
db.isSortedSetMember('topics:tid', tid, callback);
|
||||
};
|
||||
|
||||
Topics.getPageCount = function (tid, uid, callback) {
|
||||
var postCount;
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
Topics.getTopicField(tid, 'postcount', next);
|
||||
},
|
||||
function (_postCount, next) {
|
||||
if (!parseInt(_postCount, 10)) {
|
||||
return callback(null, 1);
|
||||
}
|
||||
postCount = _postCount;
|
||||
user.getSettings(uid, next);
|
||||
},
|
||||
function (settings, next) {
|
||||
next(null, Math.ceil(parseInt(postCount, 10) / settings.postsPerPage));
|
||||
},
|
||||
], callback);
|
||||
};
|
||||
|
||||
Topics.getTopicsFromSet = function (set, uid, start, stop, callback) {
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
|
||||
@@ -238,14 +238,6 @@ describe('Categories', function () {
|
||||
});
|
||||
});
|
||||
|
||||
it('should load page count', function (done) {
|
||||
socketCategories.getPageCount({ uid: posterUid }, categoryObj.cid, function (err, pageCount) {
|
||||
assert.ifError(err);
|
||||
assert.equal(pageCount, 1);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should load topic count', function (done) {
|
||||
socketCategories.getTopicCount({ uid: posterUid }, categoryObj.cid, function (err, topicCount) {
|
||||
assert.ifError(err);
|
||||
|
||||
Reference in New Issue
Block a user