tread api method properly

This commit is contained in:
Dot-Rar 2020-04-29 18:56:17 +01:00
parent 2b3b623c2c
commit cef6b3a7f9

View File

@ -16,13 +16,13 @@ func AuthenticateGuild(isApiMethod bool) gin.HandlerFunc {
parsed, err := strconv.ParseUint(guildId, 10, 64) parsed, err := strconv.ParseUint(guildId, 10, 64)
if err != nil { if err != nil {
if isApiMethod { if isApiMethod {
ctx.Redirect(302, config.Conf.Server.BaseUrl) // TODO: 404 Page
ctx.Abort()
} else {
ctx.AbortWithStatusJSON(400, gin.H{ ctx.AbortWithStatusJSON(400, gin.H{
"success": false, "success": false,
"error": "Invalid guild ID", "error": "Invalid guild ID",
}) })
} else {
ctx.Redirect(302, config.Conf.Server.BaseUrl) // TODO: 404 Page
ctx.Abort()
} }
return return
} }