mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-17 11:11:04 +01:00
refactor: deprecate socket method posts.getPidIndex
This commit is contained in:
@@ -41,6 +41,16 @@ postsAPI.get = async function (caller, data) {
|
||||
return post;
|
||||
};
|
||||
|
||||
postsAPI.getIndex = async (caller, { pid, sort }) => {
|
||||
const tid = await posts.getPostField(pid, 'tid');
|
||||
const topicPrivileges = await privileges.topics.get(tid, caller.uid);
|
||||
if (!topicPrivileges.read || !topicPrivileges['topics:read']) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return await posts.getPidIndex(pid, tid, sort);
|
||||
};
|
||||
|
||||
postsAPI.getSummary = async (caller, { pid }) => {
|
||||
const tid = await posts.getPostField(pid, 'tid');
|
||||
const topicPrivileges = await privileges.topics.get(tid, caller.uid);
|
||||
|
||||
Reference in New Issue
Block a user