fix: correct type assertions and ISBN type mismatches
- Fix type assertion panics in library.go (lines 58, 109, 237) Changed from *database.Users to database.Users to match JWT middleware - Fix ISBN type mismatch in ebook.go (lines 249, 308) Changed from pgtype.Text to string to match database schema - Fix ISBN type mismatch in ebook_scanner.go (line 421) Changed from pgtype.Text to string to match database schema These changes fix 500 errors in library creation and ebook operations.
This commit is contained in:
@@ -418,7 +418,7 @@ func (s *EbookScanner) updateEbook(ctx context.Context, ebookID pgtype.UUID, fil
|
||||
ID: ebookID,
|
||||
Title: metadata.Title,
|
||||
Author: pgtype.Text{String: metadata.Author, Valid: metadata.Author != ""},
|
||||
Isbn: pgtype.Text{String: metadata.ISBN, Valid: metadata.ISBN != ""},
|
||||
Isbn: metadata.ISBN,
|
||||
Description: pgtype.Text{String: metadata.Description, Valid: metadata.Description != ""},
|
||||
CoverImagePath: pgtype.Text{String: metadata.CoverPath, Valid: metadata.CoverPath != ""},
|
||||
Series: pgtype.Text{String: metadata.Series, Valid: metadata.Series != ""},
|
||||
|
||||
Reference in New Issue
Block a user