Skip to content

Commit

Permalink
Sort open orders by start time ASC order
Browse files Browse the repository at this point in the history
Users want to see orders that are closest to them in time which is `start_time`. The current sort order is based on `created_at` which is when the order was created. Users don't care about that.
  • Loading branch information
JohnPhamous committed Jan 6, 2025
1 parent 04dbdb5 commit c98fa4f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lib/orders/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ export function registerOrders(program: Command) {

limit: options.limit,
offset: options.offset,

sort_by: "start_time",
sort_direction: "ASC",
});

// Sort orders by start time ascending (present to future)
Expand Down Expand Up @@ -223,6 +226,9 @@ export async function getOrders(props: {

limit?: number;
offset?: number;

sort_by?: "created_at" | "start_time";
sort_direction?: "ASC" | "DESC";
}) {
const loggedIn = await isLoggedIn();
if (!loggedIn) {
Expand Down

0 comments on commit c98fa4f

Please sign in to comment.