Add pagination and API improvements
- Add pagination to effects list with infinite scroll - Refactor home stats into reusable get_user_stats function - Add /api/stats endpoint for CLI/API clients - Add has_more flag to recipes listing - Add JSON API support to storage type page Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -377,9 +377,10 @@ async def list_recipes(
|
||||
return RedirectResponse(url="/auth", status_code=302)
|
||||
|
||||
recipes = await recipe_service.list_recipes(ctx.actor_id, offset=offset, limit=limit)
|
||||
has_more = len(recipes) >= limit
|
||||
|
||||
if wants_json(request):
|
||||
return {"recipes": recipes, "offset": offset, "limit": limit}
|
||||
return {"recipes": recipes, "offset": offset, "limit": limit, "has_more": has_more}
|
||||
|
||||
from ..dependencies import get_nav_counts
|
||||
nav_counts = await get_nav_counts(ctx.actor_id)
|
||||
@@ -390,6 +391,9 @@ async def list_recipes(
|
||||
user=ctx,
|
||||
nav_counts=nav_counts,
|
||||
active_tab="recipes",
|
||||
offset=offset,
|
||||
limit=limit,
|
||||
has_more=has_more,
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user