tread api method properly
This commit is contained in:
parent
2b3b623c2c
commit
cef6b3a7f9
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user