fix: update avatar field casing and sync models

This commit is contained in:
2026-05-07 14:56:39 +02:00
parent 30f45ece89
commit 30109590ba
4 changed files with 7 additions and 7 deletions

View File

@@ -6,7 +6,7 @@ WORKDIR /app
ENV CGO_ENABLED=1 ENV CGO_ENABLED=1
# Install sqlc for code generation # Install sqlc for code generation
RUN go install github.com/sqlc-dev/sqlc/cmd/sqlc@v1.30.0 RUN go install github.com/sqlc-dev/sqlc/cmd/sqlc@v1.31.1
# Install build dependencies for bun + assets # Install build dependencies for bun + assets
RUN apt-get update && apt-get install -y ca-certificates sqlite3 curl unzip && rm -rf /var/lib/apt/lists/* RUN apt-get update && apt-get install -y ca-certificates sqlite3 curl unzip && rm -rf /var/lib/apt/lists/*

View File

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

View File

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

View File

@@ -43,7 +43,7 @@
<button class="flex items-center gap-1 rounded-full p-1 transition-colors hover:bg-surface-hover focus:outline-none"> <button class="flex items-center gap-1 rounded-full p-1 transition-colors hover:bg-surface-hover focus:outline-none">
{{with .User}} {{with .User}}
<img <img
src="{{.AvatarURL}}" src="{{.AvatarUrl}}"
alt="{{.Username}}" alt="{{.Username}}"
class="h-8 w-8 rounded-full object-cover" class="h-8 w-8 rounded-full object-cover"
/> />