-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Description
I suggest using BidsOrderBy enum Option<BidsOrderBy> (or generic OrderBy enum) to properly handle sorting in the api. This would in turn eliminate the need for some extra type conversions and more clarity.
helix/crates/common/src/api/data_api.rs
Lines 16 to 17 in f26f257
| pub order_by: Option<i8>, | |
| } |
helix/crates/database/src/postgres/postgres_db_service.rs
Lines 1585 to 1590 in f26f257
| if let Some(order) = filters.order() { | |
| query.push_str(" ORDER BY block_submission.value "); | |
| query.push_str(if order >= 0 { "ASC" } else { "DESC" }); | |
| } else { | |
| query.push_str(" ORDER BY block_submission.slot_number DESC"); | |
| } |
We can also improve the
get_delivered_payloads logic by eliminating
query.push_str(if order >= 0 { "ASC" } else { "DESC" });Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels