feat: store topic tags in topic hash (#9656)

* feat: store topic tags in topic hash

breaking: remove color info from tags (use css)

* fix: remove unused tag modal

* fix: tag search
This commit is contained in:
Barış Soner Uşaklı
2021-07-12 19:25:04 -04:00
committed by GitHub
parent 0d3f74b762
commit 4a56388ec3
14 changed files with 185 additions and 275 deletions

View File

@@ -89,8 +89,11 @@ Topics.addTags = async (req, res) => {
if (!await privileges.topics.canEdit(req.params.tid, req.user.uid)) {
return helpers.formatApiResponse(403, res);
}
const cid = await topics.getTopicField(req.params.tid, 'cid');
await topics.validateTags(req.body.tags, cid, req.user.uid, req.params.tid);
const tags = await topics.filterTags(req.body.tags);
await topics.createTags(req.body.tags, req.params.tid, Date.now());
await topics.addTags(tags, [req.params.tid]);
helpers.formatApiResponse(200, res);
};