add roles

This commit is contained in:
grngxd 2025-07-31 22:08:54 +01:00
parent 8ca089ecfb
commit b48a610e90
2 changed files with 20 additions and 19 deletions

View file

@ -38,6 +38,8 @@ type User struct {
Email string `json:"email"`
CreatedAt time.Time `json:"created_at"`
HashedApiKey string `json:"hashed_api_key"`
Role string `json:"role" gorm:"default:'free'"` // free, pro, pro+, admin
SubscriptionExpiresAt time.Time `json:"subscription_expires_at"`
}
type AvatarDecorationData struct {

View file

@ -17,7 +17,6 @@
package types
import (
"errors"
"fmt"
"github.com/gin-gonic/gin"
@ -37,7 +36,7 @@ func (e *StereoError) Throw(c *gin.Context, err error) {
if err != nil {
c.Error(err)
} else {
c.Error(errors.New(fmt.Sprintf("Got an error with code: %v", e.Code)))
c.Error(fmt.Errorf("got an error with code: %v", e.Code))
}
}