Update updateoverview.js

This commit is contained in:
404invalid-user 2021-08-30 13:37:15 +01:00 committed by GitHub
parent 0e56bb603d
commit 86a225f454
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,7 +14,7 @@ module.exports = {
let currentServer = await Server.findOne({ id: req.body.server.id });
if (currentServer == null) return res.status(404).json({ error: "404 - cant find that server in the db", message: "that server id cant be found" });
let gAccess = false;
await currentUser.guilds.forEach(guild => {
await currentUser.guilds.forEach(async (guild) => {
if (guild.id == currentServer.id) {
gAccess = true;
if (guild.userPermission == 'owner' || guild.userPermission == 'MANAGE_GUILD' || currentServer.staff.includes(currentUser.userId)) {
@ -48,4 +48,4 @@ module.exports = {
}
}
}
}