refactor(router): remove duplicate progress routes, add ProgressService to config
- Remove GET /progress/:id and POST /progress/:id from progress routes. These were superseded by the media-item progress routes. Only GET /progress/:id/history remains. - Add ProgressService to router.Config so sync.go can inject it into KoboHandler via SetProgressService(). - Inject ProgressService into KoboHandler at route registration time rather than requiring a separate setup step. - Update comment from 'Legacy progress routes' to 'Progress routes'.
This commit is contained in:
@@ -32,6 +32,7 @@ func registerSyncRoutes(cfg *Config) {
|
||||
// Kobo devices use URL path: /api/sync/kobo/{token}/markup
|
||||
// API clients can use Authorization header: Authorization: Bearer {token}
|
||||
koboHandler := handlers.NewKoboHandler(cfg.Queries, cfg.ConnManager)
|
||||
koboHandler.SetProgressService(cfg.ProgressService)
|
||||
koboSync := e.Group("/api/sync/kobo/:token")
|
||||
koboSync.POST("/markup", cfg.DeviceAuthMiddleware.Authenticate(koboHandler.Markup))
|
||||
koboSync.POST("/bookmark", cfg.DeviceAuthMiddleware.Authenticate(koboHandler.Bookmark))
|
||||
|
||||
Reference in New Issue
Block a user