24 lines
462 B
Go
24 lines
462 B
Go
package botstaff
|
|
|
|
import (
|
|
"github.com/TicketsBot/GoPanel/database"
|
|
"github.com/TicketsBot/GoPanel/utils"
|
|
"github.com/gin-gonic/gin"
|
|
"strconv"
|
|
)
|
|
|
|
func AddBotStaffHandler(ctx *gin.Context) {
|
|
userId, err := strconv.ParseUint(ctx.Param("userid"), 10, 64)
|
|
if err != nil {
|
|
ctx.JSON(400, utils.ErrorJson(err))
|
|
return
|
|
}
|
|
|
|
if err := database.Client.BotStaff.Add(ctx, userId); err != nil {
|
|
ctx.JSON(500, utils.ErrorJson(err))
|
|
return
|
|
}
|
|
|
|
ctx.Status(204)
|
|
}
|