Skip to content

Commit

Permalink
improve index sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 committed Sep 9, 2024
1 parent c660ad7 commit 06a26c7
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions server/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@ async def _(
raise BadRequestException(f"{patch_type} is not valid")

where, arg = patch_state_filter.to_sql(index=1)
if patch_state_filter == StateFilter.Pending:
order_by = "created_at asc"
elif patch_state_filter == StateFilter.All:
if patch_state_filter in {StateFilter.Pending, StateFilter.All}:
order_by = "created_at desc"
else:
order_by = "updated_at desc"
Expand Down

0 comments on commit 06a26c7

Please sign in to comment.