dashboard/app/http/endpoints/api/whitelabel/whitelabelgeterrors.go
2022-06-21 19:26:54 +01:00

23 lines
426 B
Go

package api
import (
"github.com/TicketsBot/GoPanel/database"
"github.com/TicketsBot/GoPanel/utils"
"github.com/gin-gonic/gin"
)
func WhitelabelGetErrors(ctx *gin.Context) {
userId := ctx.Keys["userid"].(uint64)
errors, err := database.Client.WhitelabelErrors.GetRecent(userId, 10)
if err != nil {
ctx.JSON(500, utils.ErrorJson(err))
return
}
ctx.JSON(200, gin.H{
"success": true,
"errors": errors,
})
}