mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-30 12:20:38 +01:00
refactor: remove posts.tools.purge
moved the check to socketPosts.purge
This commit is contained in:
@@ -41,13 +41,4 @@ module.exports = function (Posts) {
|
||||
}
|
||||
return post;
|
||||
}
|
||||
|
||||
Posts.tools.purge = async function (uid, pid) {
|
||||
const canPurge = await privileges.posts.canPurge(pid, uid);
|
||||
if (!canPurge) {
|
||||
throw new Error('[[error:no-privileges]]');
|
||||
}
|
||||
require('./cache').del(pid);
|
||||
await Posts.purge(pid, uid);
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user