Skip to content

Commit

Permalink
fix: update post-queue hook names
Browse files Browse the repository at this point in the history
  • Loading branch information
julianlam committed Aug 28, 2020
1 parent 3b960c3 commit 0e58d2b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/controllers/mods.js
Expand Up @@ -216,6 +216,11 @@ modsController.postQueue = async function (req, res, next) {
let postData = await getQueuedPosts(ids);
postData = postData.filter(p => p && (isAdminOrGlobalMod || moderatedCids.includes(String(p.category.cid))));

({ posts: postData } = await plugins.fireHook('filter:post-queue.get', {
posts: postData,
req: req,
}));

const pageCount = Math.max(1, Math.ceil(postData.length / postsPerPage));
const start = (page - 1) * postsPerPage;
const stop = start + postsPerPage - 1;
Expand Down
2 changes: 1 addition & 1 deletion src/posts/queue.js
Expand Up @@ -57,7 +57,7 @@ module.exports = function (Posts) {
type: type,
data: data,
};
payload = await plugins.fireHook('filter:post.queue', payload);
payload = await plugins.fireHook('filter:post-queue.save', payload);
payload.data = JSON.stringify(data);

await db.sortedSetAdd('post:queue', now, id);
Expand Down

0 comments on commit 0e58d2b

Please sign in to comment.