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
+1
View File
@@ -82,6 +82,7 @@ func SetupRoutes(g *echo.Group, db *database.Queries, connManager *wsync.Connect
collections.POST("/:id/books", collectionHandler.AddBooks)
collections.DELETE("/:id/books/:bookId", collectionHandler.RemoveBook)
collections.POST("/:id/books/bulk-remove", collectionHandler.BulkRemoveBooks)
collections.POST("/bulk-add-books", collectionHandler.HandleBulkAddBooks)
collections.POST("/test-rules", collectionHandler.TestRules)
// Device shelf mapping routes