dashboard-v2/app/http/endpoints/api/whitelabel/whitelabelgeterrors.go
2024-07-20 23:37:50 +01:00

23 lines
431 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(ctx, userId, 10)
if err != nil {
ctx.JSON(500, utils.ErrorJson(err))
return
}
ctx.JSON(200, gin.H{
"success": true,
"errors": errors,
})
}