Merge branch 'master' into develop

This commit is contained in:
Barış Soner Uşaklı
2025-06-05 07:16:00 -04:00
18 changed files with 590 additions and 260 deletions

View File

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

View File

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