Skip to content

Commit

Permalink
fix: show admins/globalmods if content is purged
Browse files Browse the repository at this point in the history
  • Loading branch information
barisusakli committed Feb 8, 2023
1 parent e335d0f commit 326b926
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/controllers/mods.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ modsController.flags.detail = async function (req, res, next) {
uids = _.uniq(admins.concat(uids));
} else if (flagData.type === 'post') {
const cid = await posts.getCidByPid(flagData.targetId);
if (!cid) {
return [];
uids = _.uniq(admins.concat(globalMods));
if (cid) {
const modUids = (await privileges.categories.getUidsWithPrivilege([cid], 'moderate'))[0];
uids = _.uniq(uids.concat(modUids));
}
uids = (await privileges.categories.getUidsWithPrivilege([cid], 'moderate'))[0];
uids = _.uniq(admins.concat(globalMods).concat(uids));
}
const userData = await user.getUsersData(uids);
return userData.filter(u => u && u.userslug);
Expand Down

0 comments on commit 326b926

Please sign in to comment.