mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-24 01:10:31 +01:00
minor refactor
This commit is contained in:
@@ -144,18 +144,14 @@ SocketPosts.getRawPost = function(socket, pid, callback) {
|
|||||||
return next(new Error('[[error:no-privileges]]'));
|
return next(new Error('[[error:no-privileges]]'));
|
||||||
}
|
}
|
||||||
posts.getPostFields(pid, ['content', 'deleted'], next);
|
posts.getPostFields(pid, ['content', 'deleted'], next);
|
||||||
|
},
|
||||||
|
function(postData, next) {
|
||||||
|
if (parseInt(postData.deleted, 10) === 1) {
|
||||||
|
return next(new Error('[[error:no-post]]'));
|
||||||
|
}
|
||||||
|
next(null, postData.content);
|
||||||
}
|
}
|
||||||
], function(err, post) {
|
], callback);
|
||||||
if(err) {
|
|
||||||
return callback(err);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(parseInt(post.deleted, 10) === 1) {
|
|
||||||
return callback(new Error('[[error:no-post]]'));
|
|
||||||
}
|
|
||||||
|
|
||||||
callback(null, post.content);
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
SocketPosts.edit = function(socket, data, callback) {
|
SocketPosts.edit = function(socket, data, callback) {
|
||||||
|
|||||||
Reference in New Issue
Block a user