refactor: move resolve flags and activitypub.out.remove.context

after topic deletion
This commit is contained in:
Barış Soner Uşaklı
2026-03-03 12:54:14 -05:00
parent 2428602f27
commit 88b91c20d9

View File

@@ -20,16 +20,17 @@ module.exports = function (Topics) {
]); ]);
await Promise.all([ await Promise.all([
db.sortedSetRemove(`cid:${cid}:pids`, pids), db.sortedSetRemove(`cid:${cid}:pids`, pids),
resolveTopicPostFlags(pids, uid),
Topics.setTopicFields(tid, { Topics.setTopicFields(tid, {
deleted: 1, deleted: 1,
deleterUid: uid, deleterUid: uid,
deletedTimestamp: Date.now(), deletedTimestamp: Date.now(),
}), }),
activitypub.out.remove.context(uid, tid),
]); ]);
await Promise.all([
await categories.updateRecentTidForCid(cid); resolveTopicPostFlags(pids, uid),
activitypub.out.remove.context(uid, tid),
categories.updateRecentTidForCid(cid),
]);
}; };
async function resolveTopicPostFlags(pids, uid) { async function resolveTopicPostFlags(pids, uid) {