Skip to content

Commit

Permalink
Fix sortBy/sortOrder on Message/Post queries
Browse files Browse the repository at this point in the history
  • Loading branch information
philogicae committed Feb 19, 2024
1 parent 7b70409 commit 5a74348
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/aleph/web/controllers/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,21 @@
class BaseMessageQueryParams(BaseModel):
sort_by: SortBy = Field(
default=SortBy.TIME,
alias="sortBy",
description="Key to use to sort the messages. "
"'time' uses the message time field. "
"'tx-time' uses the first on-chain confirmation time.",
)
sort_order: SortOrder = Field(
default=SortOrder.DESCENDING,
alias="sortOrder",
description="Order in which messages should be listed: "
"-1 means most recent messages first, 1 means older messages first.",
)
message_type: Optional[MessageType] = Field(
default=None, alias="msgType", description="Message type. Deprecated: use msgTypes instead"
default=None,
alias="msgType",
description="Message type. Deprecated: use msgTypes instead",
)
message_types: Optional[List[MessageType]] = Field(
default=None, alias="msgTypes", description="Accepted message types."
Expand Down
2 changes: 2 additions & 0 deletions src/aleph/web/controllers/posts.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,14 @@ class PostQueryParams(BaseModel):
)
sort_by: SortBy = Field(
default=SortBy.TIME,
alias="sortBy",
description="Key to use to sort the posts. "
"'time' uses the post creation time field. "
"'tx-time' uses the first on-chain confirmation time.",
)
sort_order: SortOrder = Field(
default=SortOrder.DESCENDING,
alias="sortOrder",
description="Order in which messages should be listed: "
"-1 means most recent messages first, 1 means older messages first.",
)
Expand Down

0 comments on commit 5a74348

Please sign in to comment.