feat(writeapi): topic tags

This commit is contained in:
Julian Lam
2020-10-06 11:54:25 -04:00
parent 9be5629458
commit 1605e5e443
3 changed files with 144 additions and 32 deletions

View File

@@ -138,6 +138,16 @@ Topics.unfollow = async (req, res) => {
helpers.formatApiResponse(200, res);
};
Topics.addTags = async (req, res) => {
await topics.createTags(req.body.tags, req.params.tid, Date.now());
helpers.formatApiResponse(200, res);
};
Topics.deleteTags = async (req, res) => {
await topics.deleteTopicTags(req.params.tid);
helpers.formatApiResponse(200, res);
};
async function doTopicAction(action, event, socket, { tids }) {
if (!Array.isArray(tids)) {
throw new Error('[[error:invalid-tid]]');