mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 23:15:48 +01:00
cleanup toggleFollow
This commit is contained in:
@@ -210,17 +210,13 @@ var winston = require('winston'),
|
||||
|
||||
ThreadTools.toggleFollow = function(tid, uid, callback) {
|
||||
topics.isFollowing(tid, uid, function(err, following) {
|
||||
if(err) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
db[following ? 'setRemove' : 'setAdd']('tid:' + tid + ':followers', uid, function(err, success) {
|
||||
if (callback) {
|
||||
if(err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
callback(null, !following);
|
||||
db[following ? 'setRemove' : 'setAdd']('tid:' + tid + ':followers', uid, function(err) {
|
||||
if (typeof callback === 'function') {
|
||||
callback(err, !following);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user