dashboard/app/http/endpoints/api/blacklist/blacklistremoverole.go
2024-07-20 23:37:50 +01:00

26 lines
522 B
Go

package api
import (
"github.com/TicketsBot/GoPanel/database"
"github.com/TicketsBot/GoPanel/utils"
"github.com/gin-gonic/gin"
"strconv"
)
func RemoveRoleBlacklistHandler(ctx *gin.Context) {
guildId := ctx.Keys["guildid"].(uint64)
roleId, err := strconv.ParseUint(ctx.Param("role"), 10, 64)
if err != nil {
ctx.JSON(400, utils.ErrorJson(err))
return
}
if err := database.Client.RoleBlacklist.Remove(ctx, guildId, roleId); err != nil {
ctx.JSON(500, utils.ErrorJson(err))
return
}
ctx.Status(204)
}