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
This commit is contained in:
@@ -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 != ""},
|
||||
|
||||
Reference in New Issue
Block a user