mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-08-12 02:37:36 +02:00
Merge branch 'master' into develop
This commit is contained in:
@@ -237,6 +237,7 @@ modsController.postQueue = async function (req, res, next) {
|
||||
.map((post) => {
|
||||
const isSelf = post.user.uid === req.uid;
|
||||
post.canAccept = !isSelf && (isAdmin || isGlobalMod || !!moderatedCids.length);
|
||||
post.canEdit = isSelf || isAdmin || isGlobalMod;
|
||||
return post;
|
||||
});
|
||||
|
||||
|
||||
@@ -189,3 +189,24 @@ Posts.getReplies = async (req, res) => {
|
||||
|
||||
helpers.formatApiResponse(200, res, { replies });
|
||||
};
|
||||
|
||||
Posts.acceptQueuedPost = async (req, res) => {
|
||||
const post = await api.posts.acceptQueuedPost(req, { id: req.params.id });
|
||||
helpers.formatApiResponse(200, res, { post });
|
||||
};
|
||||
|
||||
Posts.removeQueuedPost = async (req, res) => {
|
||||
await api.posts.removeQueuedPost(req, { id: req.params.id });
|
||||
helpers.formatApiResponse(200, res);
|
||||
};
|
||||
|
||||
Posts.editQueuedPost = async (req, res) => {
|
||||
const result = await api.posts.editQueuedPost(req, { id: req.params.id, ...req.body });
|
||||
helpers.formatApiResponse(200, res, result);
|
||||
};
|
||||
|
||||
Posts.notifyQueuedPostOwner = async (req, res) => {
|
||||
const { id } = req.params;
|
||||
await api.posts.notifyQueuedPostOwner(req, { id, message: req.body.message });
|
||||
helpers.formatApiResponse(200, res);
|
||||
};
|
||||
Reference in New Issue
Block a user