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)
|
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
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user