diff --git a/app/services/recipe_service.py b/app/services/recipe_service.py index bae3043..321792b 100644 --- a/app/services/recipe_service.py +++ b/app/services/recipe_service.py @@ -34,7 +34,7 @@ class RecipeService: return None - async def list_recipes(self, actor_id: str = None, page: int = 1, limit: int = 20) -> Dict[str, Any]: + async def list_recipes(self, actor_id: str = None, offset: int = 0, limit: int = 20) -> list: """List available recipes with pagination.""" recipes = [] cursor = 0 @@ -59,20 +59,7 @@ class RecipeService: recipes.sort(key=lambda r: r.get("name", "")) # Paginate - total = len(recipes) - start = (page - 1) * limit - end = start + limit - page_recipes = recipes[start:end] - - return { - "recipes": page_recipes, - "pagination": { - "page": page, - "limit": limit, - "total": total, - "has_more": end < total, - } - } + return recipes[offset:offset + limit] async def save_recipe(self, recipe_id: str, recipe_data: Dict[str, Any]) -> None: """Save a recipe to Redis."""