fix(post-queue): moderatedCids is an array of numbers (#9631)

v1.18.x
Anton Grigoryev 4 years ago committed by GitHub
parent cf6fcc2107
commit db65360c0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -165,13 +165,13 @@ modsController.postQueue = async function (req, res, next) {
helpers.getSelectedCategory(cid), helpers.getSelectedCategory(cid),
]); ]);
if (cid && !moderatedCids.includes(String(cid)) && !isAdminOrGlobalMod) { if (cid && !moderatedCids.includes(Number(cid)) && !isAdminOrGlobalMod) {
return next(); return next();
} }
postData = postData.filter(p => p && postData = postData.filter(p => p &&
(!categoriesData.selectedCids.length || categoriesData.selectedCids.includes(p.category.cid)) && (!categoriesData.selectedCids.length || categoriesData.selectedCids.includes(p.category.cid)) &&
(isAdminOrGlobalMod || moderatedCids.includes(String(p.category.cid)))); (isAdminOrGlobalMod || moderatedCids.includes(Number(p.category.cid))));
({ posts: postData } = await plugins.hooks.fire('filter:post-queue.get', { ({ posts: postData } = await plugins.hooks.fire('filter:post-queue.get', {
posts: postData, posts: postData,

Loading…
Cancel
Save