refactor: simplify router configuration and handler setup

- Move JWT middleware creation to shared function
- Simplify library route registration
- Add bulk-add-books endpoint to collections
- Clean up duplicate handler setup code
- Improve route organization and maintainability
This commit is contained in:
2026-02-06 17:04:17 -05:00
parent aee7fb4960
commit a75cd7e51a
4 changed files with 11 additions and 18 deletions
+2 -2
View File
@@ -12,8 +12,8 @@ func registerSyncRoutes(cfg *Config) {
protected := e.Group("/api", jwtMiddleware)
// Setup ebook handler routes first
h := handlers.SetupRoutes(protected, cfg.Queries, cfg.ConnManager)
// Create handler for sync-specific routes
h := handlers.NewHandler(cfg.Queries, cfg.ConnManager)
// Book matching and unlinked book resolution routes
sync := protected.Group("/sync")