feat: add user avatar with dicebear dylan

This commit is contained in:
2026-05-07 13:42:21 +02:00
parent 83e480b7b0
commit b5083035f5
6 changed files with 60 additions and 16 deletions

View File

@@ -64,9 +64,10 @@ type Session struct {
type User struct {
ID string `json:"id"`
Username string `json:"username"`
PasswordHash string `json:"password_hash"`
CreatedAt time.Time `json:"created_at"`
Username string `json:"username"`
PasswordHash string `json:"password_hash"`
AvatarURL string `json:"avatar_url"`
CreatedAt time.Time `json:"created_at"`
}
type WatchListEntry struct {

View File

@@ -469,7 +469,7 @@ func (q *Queries) GetUpcomingSeasons(ctx context.Context, userID string) ([]GetU
}
const getUser = `-- name: GetUser :one
SELECT id, username, password_hash, created_at FROM user WHERE id = ? LIMIT 1
SELECT id, username, password_hash, avatar_url, created_at FROM user WHERE id = ? LIMIT 1
`
func (q *Queries) GetUser(ctx context.Context, id string) (User, error) {
@@ -479,13 +479,14 @@ func (q *Queries) GetUser(ctx context.Context, id string) (User, error) {
&i.ID,
&i.Username,
&i.PasswordHash,
&i.AvatarURL,
&i.CreatedAt,
)
return i, err
}
const getUserByUsername = `-- name: GetUserByUsername :one
SELECT id, username, password_hash, created_at FROM user WHERE username = ? LIMIT 1
SELECT id, username, password_hash, avatar_url, created_at FROM user WHERE username = ? LIMIT 1
`
func (q *Queries) GetUserByUsername(ctx context.Context, username string) (User, error) {
@@ -495,6 +496,7 @@ func (q *Queries) GetUserByUsername(ctx context.Context, username string) (User,
&i.ID,
&i.Username,
&i.PasswordHash,
&i.AvatarURL,
&i.CreatedAt,
)
return i, err