breaking: remove socket.emit('posts.move')

This commit is contained in:
Barış Soner Uşaklı
2021-12-09 18:59:23 -05:00
parent 4247f62441
commit 8427c5d9db
4 changed files with 55 additions and 93 deletions

View File

@@ -208,6 +208,12 @@ async function isMainAndLastPost(pid) {
}
postsAPI.move = async function (caller, data) {
if (!caller.uid) {
throw new Error('[[error:not-logged-in]]');
}
if (!data || !data.pid || !data.tid) {
throw new Error('[[error:invalid-data]]');
}
const canMove = await Promise.all([
privileges.topics.isAdminOrMod(data.tid, caller.uid),
privileges.posts.canMove(data.pid, caller.uid),