fix: show admins/globalmods if content is purged

isekai-main
Barış Soner Uşaklı 2 years ago
parent e335d0f601
commit 326b92687f

@ -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);

Loading…
Cancel
Save