refactor: remove posts.tools.purge

moved the check to socketPosts.purge
This commit is contained in:
Barış Soner Uşaklı
2020-10-06 14:03:59 -04:00
parent dde5b6b814
commit ed092bf6b5
2 changed files with 6 additions and 10 deletions

View File

@@ -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);
};
};