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:
@@ -313,3 +313,8 @@ func (h *LibraryHandler) GetUserVisibleLibrariesData(ctx context.Context, userID
|
|||||||
func (h *LibraryHandler) GetLibraryTypeData(ctx context.Context) ([]database.LibraryTypes, error) {
|
func (h *LibraryHandler) GetLibraryTypeData(ctx context.Context) ([]database.LibraryTypes, error) {
|
||||||
return h.libraryService.GetLibraryTypes(ctx)
|
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)
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user