From c98fa4f1cdb12e09a4f03b97bf63b138f166fac6 Mon Sep 17 00:00:00 2001 From: John Pham Date: Mon, 6 Jan 2025 12:14:44 -0800 Subject: [PATCH] Sort open orders by start time ASC order 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. --- src/lib/orders/index.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib/orders/index.tsx b/src/lib/orders/index.tsx index a66e960..563c27a 100644 --- a/src/lib/orders/index.tsx +++ b/src/lib/orders/index.tsx @@ -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) @@ -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) {