Skip to content

Commit

Permalink
chore: misc checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Vedantsahai18 committed Dec 25, 2024
1 parent 88ca072 commit 6a5fe63
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions agents-api/agents_api/queries/executions/list_executions.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@ async def list_executions(
Returns:
tuple[str, list]: SQL query and parameters for listing executions.
"""

if sort_by not in ["created_at", "updated_at"]:
raise HTTPException(status_code=400, detail="Invalid sort field")

if limit > 100 or limit < 1:
raise HTTPException(status_code=400, detail="Limit must be between 1 and 100")

if offset < 0:
raise HTTPException(status_code=400, detail="Offset must be >= 0")

return (
list_executions_query,
[
Expand Down

0 comments on commit 6a5fe63

Please sign in to comment.