mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-14 18:47:32 +01:00
Post queue write api (#13473)
* move post queue from socket.io to rest api * move harmony post-queue to core add canEdit, allow users to edit their queued posts * fix: openapi spec * lint: whitespace
This commit is contained in:
@@ -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