mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 12:05:57 +01:00
on post flag increment zset
This commit is contained in:
@@ -337,6 +337,9 @@ Flags.create = function (type, id, uid, reason, timestamp, callback) {
|
||||
}
|
||||
if (type === 'post') {
|
||||
tasks.push(async.apply(db.sortedSetAdd.bind(db), 'flags:byPid:' + id, timestamp, flagId)); // by target pid
|
||||
if (targetUid) {
|
||||
tasks.push(async.apply(db.sortedSetIncrBy, 'users:flags', 1, targetUid));
|
||||
}
|
||||
}
|
||||
|
||||
async.parallel(tasks, function (err) {
|
||||
|
||||
Reference in New Issue
Block a user