mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
feat: add vote status to getPostData API call
This commit is contained in:
@@ -133,14 +133,16 @@ apiController.getPostData = function (pid, uid, callback) {
|
||||
post: function (next) {
|
||||
posts.getPostData(pid, next);
|
||||
},
|
||||
voted: async.apply(posts.hasVoted, pid, uid),
|
||||
}, function (err, results) {
|
||||
if (err || !results.post) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
var post = results.post;
|
||||
var privileges = results.privileges[0];
|
||||
Object.assign(post, results.voted);
|
||||
|
||||
var privileges = results.privileges[0];
|
||||
if (!privileges.read || !privileges['topics:read']) {
|
||||
return callback();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user