fix: #8287, fix users:flags as well

This commit is contained in:
Barış Soner Uşaklı
2020-05-02 15:34:58 -04:00
parent 919034a7db
commit 5ebcdb1806
3 changed files with 10 additions and 2 deletions

View File

@@ -296,8 +296,7 @@ Flags.create = async function (type, id, uid, reason, timestamp) {
if (type === 'post') {
await db.sortedSetAdd('flags:byPid:' + id, timestamp, flagId); // by target pid
if (targetUid) {
await db.sortedSetIncrBy('users:flags', 1, targetUid);
await user.incrementUserFieldBy(targetUid, 'flags', 1);
await user.incrementUserFlagsBy(targetUid, 1);
}
}