mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-09-02 04:16:36 +02:00
feat(topic-events): topic events GET route in write API
This commit is contained in:
@@ -181,3 +181,11 @@ async function checkThumbPrivileges({ tid, uid, res }) {
|
||||
return helpers.formatApiResponse(403, res, new Error('[[error:no-privileges]]'));
|
||||
}
|
||||
}
|
||||
|
||||
Topics.getEvents = async (req, res) => {
|
||||
if (!await privileges.topics.can('topics:read', req.params.tid, req.uid)) {
|
||||
return helpers.formatApiResponse(403, res);
|
||||
}
|
||||
|
||||
helpers.formatApiResponse(200, res, await topics.events.get(req.params.tid));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user