mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 03:55:55 +01:00
generic getObject
This commit is contained in:
@@ -313,21 +313,5 @@ topicsController.teaser = function(req, res, next) {
|
||||
});
|
||||
};
|
||||
|
||||
topicsController.getTopic = function(req, res, next) {
|
||||
async.parallel({
|
||||
canRead: async.apply(privileges.topics.can, 'read', req.params.tid, req.uid),
|
||||
topicData: async.apply(topics.getTopicData, req.params.tid)
|
||||
}, function(err, results) {
|
||||
if (err || !results.topicData) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
if (!results.canRead) {
|
||||
return helpers.notAllowed(req, res);
|
||||
}
|
||||
|
||||
res.json(results.topicData);
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = topicsController;
|
||||
|
||||
Reference in New Issue
Block a user