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
This commit is contained in:
2026-02-22 21:05:57 -05:00
parent f7e1eab31d
commit 3174ec16bc
+5
View File
@@ -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)
}