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:
Barış Uşaklı
2025-06-05 07:15:45 -04:00
committed by GitHub
parent 6d40a2118c
commit 4fbcfae8b1
13 changed files with 521 additions and 259 deletions

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