Skip to content

Commit

Permalink
fix sort param typo
Browse files Browse the repository at this point in the history
  • Loading branch information
daya0576 committed Dec 15, 2024
1 parent bec0362 commit ccfad9a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions beaverhabits/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ async def get_habit_completions(
status_code=400, detail="Both date_start and date_end are required"
)

if sort not in ("asc", "desc"):
raise HTTPException(status_code=400, detail="Invalid sort value")
ticked_days = sorted(ticked_days, reverse=sort == "desc")

if limit:
Expand Down

0 comments on commit ccfad9a

Please sign in to comment.