From cef6b3a7f95cdd124628a23eb8343aec3383af4a Mon Sep 17 00:00:00 2001 From: Dot-Rar Date: Wed, 29 Apr 2020 18:56:17 +0100 Subject: [PATCH] tread api method properly --- app/http/middleware/authenticateguild.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/http/middleware/authenticateguild.go b/app/http/middleware/authenticateguild.go index 6eb5af5..32837d8 100644 --- a/app/http/middleware/authenticateguild.go +++ b/app/http/middleware/authenticateguild.go @@ -16,13 +16,13 @@ func AuthenticateGuild(isApiMethod bool) gin.HandlerFunc { parsed, err := strconv.ParseUint(guildId, 10, 64) if err != nil { if isApiMethod { - ctx.Redirect(302, config.Conf.Server.BaseUrl) // TODO: 404 Page - ctx.Abort() - } else { ctx.AbortWithStatusJSON(400, gin.H{ "success": false, "error": "Invalid guild ID", }) + } else { + ctx.Redirect(302, config.Conf.Server.BaseUrl) // TODO: 404 Page + ctx.Abort() } return }