feat: add Kobo device sync support and fix device route protection
- Add Kobo sync handler with markup, bookmark, analytics, and initialization endpoints - Add Kobo integration tests and Bruno API test collection - Move device approve/reject routes from public to protected routes - Enhance test infrastructure with DATABASE_URL support and helper functions - Fix device GetDevice handler nil pointer handling - Clean up test reports and session files
This commit is contained in:
@@ -273,8 +273,12 @@ func (h *DeviceHandler) ListDevices(c echo.Context) error {
|
||||
}
|
||||
|
||||
func (h *DeviceHandler) GetDevice(c echo.Context) error {
|
||||
userID := c.Get("user_id").(string)
|
||||
userUUID, err := uuid.Parse(userID)
|
||||
userID := c.Get("user_id")
|
||||
if userID == nil {
|
||||
return c.JSON(http.StatusUnauthorized, map[string]string{"error": "unauthorized"})
|
||||
}
|
||||
|
||||
userUUID, err := uuid.Parse(userID.(string))
|
||||
if err != nil {
|
||||
return c.JSON(http.StatusBadRequest, map[string]string{"error": "invalid user ID"})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user