mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 17:16:14 +01:00
feat(writeapi): topic follow/ignore
This commit is contained in:
@@ -123,6 +123,21 @@ Topics.unlock = async (req, res) => {
|
||||
helpers.formatApiResponse(200, res);
|
||||
};
|
||||
|
||||
Topics.follow = async (req, res) => {
|
||||
await topics.follow(req.params.tid, req.user.uid);
|
||||
helpers.formatApiResponse(200, res);
|
||||
};
|
||||
|
||||
Topics.ignore = async (req, res) => {
|
||||
await topics.ignore(req.params.tid, req.user.uid);
|
||||
helpers.formatApiResponse(200, res);
|
||||
};
|
||||
|
||||
Topics.unfollow = async (req, res) => {
|
||||
await topics.unfollow(req.params.tid, req.user.uid);
|
||||
helpers.formatApiResponse(200, res);
|
||||
};
|
||||
|
||||
async function doTopicAction(action, event, socket, { tids }) {
|
||||
if (!Array.isArray(tids)) {
|
||||
throw new Error('[[error:invalid-tid]]');
|
||||
|
||||
Reference in New Issue
Block a user