From 41c0f96cb299c484b741bf55ae7658fbc4066b8b Mon Sep 17 00:00:00 2001 From: rxdn <29165304+rxdn@users.noreply.github.com> Date: Tue, 12 Jul 2022 14:13:08 +0100 Subject: [PATCH] Remove unneccessary queries --- app/http/middleware/authenticateguild.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/http/middleware/authenticateguild.go b/app/http/middleware/authenticateguild.go index 17b20d0..f749b9f 100644 --- a/app/http/middleware/authenticateguild.go +++ b/app/http/middleware/authenticateguild.go @@ -22,7 +22,7 @@ func AuthenticateGuild(requiredPermissionLevel permission.PermissionLevel) gin.H ctx.Keys["guildid"] = parsed // TODO: Do we need this? Only really serves as a check whether the bot is in the server - guild, found := cache.Instance.GetGuild(parsed, false) + _, found := cache.Instance.GetGuildOwner(parsed) if !found { ctx.JSON(404, utils.ErrorStr("Guild not found")) ctx.Abort() @@ -32,7 +32,7 @@ func AuthenticateGuild(requiredPermissionLevel permission.PermissionLevel) gin.H // Verify the user has permissions to be here userId := ctx.Keys["userid"].(uint64) - permLevel, err := utils.GetPermissionLevel(guild.Id, userId) + permLevel, err := utils.GetPermissionLevel(parsed, userId) if err != nil { ctx.JSON(500, utils.ErrorJson(err)) ctx.Abort()