mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: missing await in SocketPosts.changeOwner
This commit is contained in:
committed by
Julian Lam
parent
dd440ce902
commit
0ae1eb4f6e
@@ -167,7 +167,7 @@ module.exports = function (SocketPosts) {
|
|||||||
if (!data || !Array.isArray(data.pids) || !data.toUid) {
|
if (!data || !Array.isArray(data.pids) || !data.toUid) {
|
||||||
throw new Error('[[error:invalid-data]]');
|
throw new Error('[[error:invalid-data]]');
|
||||||
}
|
}
|
||||||
const isAdminOrGlobalMod = user.isAdminOrGlobalMod(socket.uid);
|
const isAdminOrGlobalMod = await user.isAdminOrGlobalMod(socket.uid);
|
||||||
if (!isAdminOrGlobalMod) {
|
if (!isAdminOrGlobalMod) {
|
||||||
throw new Error('[[error:no-privileges]]');
|
throw new Error('[[error:no-privileges]]');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user