From 74e8815bd3d60e104c8f41bd7fe64bf38da328c7 Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Fri, 30 Jan 2026 13:51:48 -0500 Subject: [PATCH] fix: handler ISBN field type corrections - Fix CreateMediaItem ISBN field to use pgtype.Text wrapper - Fix UpdateMediaItem to use correct Isbn field name - Resolve type mismatch between request and database params Resolves compilation errors in media item handlers --- internal/handlers/ebook.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/handlers/ebook.go b/internal/handlers/ebook.go index 757e008..1d165b7 100644 --- a/internal/handlers/ebook.go +++ b/internal/handlers/ebook.go @@ -795,7 +795,7 @@ func (h *Handler) CreateMediaItem(c echo.Context) error { LibraryID: pgtype.UUID{Bytes: req.LibraryID, Valid: true}, Title: req.Title, Author: pgtype.Text{String: req.Author, Valid: req.Author != ""}, - Isbn: req.ISBN, + Isbn: pgtype.Text{String: req.ISBN, Valid: req.ISBN != ""}, Description: pgtype.Text{String: req.Description, Valid: req.Description != ""}, FilePath: req.FilePath, FileSize: pgtype.Int8{Int64: req.FileSize, Valid: req.FileSize > 0}, @@ -866,7 +866,7 @@ func (h *Handler) UpdateMediaItem(c echo.Context) error { ID: pgtype.UUID{Bytes: mediaUUID, Valid: true}, Title: req.Title, Author: pgtype.Text{String: req.Author, Valid: req.Author != ""}, - Isbn: req.ISBN, + Isbn: pgtype.Text{String: req.ISBN, Valid: req.ISBN != ""}, Description: pgtype.Text{String: req.Description, Valid: req.Description != ""}, CoverImagePath: pgtype.Text{String: req.CoverImagePath, Valid: req.CoverImagePath != ""}, Series: pgtype.Text{String: req.Series, Valid: req.Series != ""},