mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-17 19:21:04 +01:00
refactor: topic follow/ignore to use api lib
This commit is contained in:
@@ -120,6 +120,18 @@ topicsAPI.unlock = async function (caller, data) {
|
||||
});
|
||||
};
|
||||
|
||||
topicsAPI.follow = async function (caller, data) {
|
||||
await topics.follow(data.tid, caller.uid);
|
||||
};
|
||||
|
||||
topicsAPI.ignore = async function (caller, data) {
|
||||
await topics.ignore(data.tid, caller.uid);
|
||||
};
|
||||
|
||||
topicsAPI.unfollow = async function (caller, data) {
|
||||
await topics.unfollow(data.tid, caller.uid);
|
||||
};
|
||||
|
||||
async function doTopicAction(action, event, caller, { tids }) {
|
||||
if (!Array.isArray(tids)) {
|
||||
throw new Error('[[error:invalid-tid]]');
|
||||
|
||||
Reference in New Issue
Block a user