From 3174ec16bcf004cc4da3e278bc1cd7578ec2577f Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Sun, 22 Feb 2026 21:05:57 -0500 Subject: [PATCH] feat(backend): Add SSR data helper for admin library page Add ListLibrariesData() method to LibraryHandler to support server-side rendering of all libraries on the /admin/library page. This follows the existing pattern of GetUserVisibleLibrariesData() and GetLibraryTypeData() methods, which return data structures instead of JSON for template rendering. Changes: - Add ListLibrariesData() method (3 lines) - Returns []database.ListLibrariesRow for template consumption - Called by frontend route handler for SSR --- internal/handlers/library.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/handlers/library.go b/internal/handlers/library.go index 3d19bdb..40d1520 100644 --- a/internal/handlers/library.go +++ b/internal/handlers/library.go @@ -313,3 +313,8 @@ func (h *LibraryHandler) GetUserVisibleLibrariesData(ctx context.Context, userID func (h *LibraryHandler) GetLibraryTypeData(ctx context.Context) ([]database.LibraryTypes, error) { return h.libraryService.GetLibraryTypes(ctx) } + +// ListLibrariesData returns all libraries for SSR (admin only, not JSON response) +func (h *LibraryHandler) ListLibrariesData(ctx context.Context) ([]database.ListLibrariesRow, error) { + return h.libraryService.ListLibraries(ctx) +}