Compare commits

..
Author SHA1 Message Date
Karina Hottinger 03663c4042 fix case-insensitive order search
Runner Test / test (push) Successful in 16s
Runner Test / test (pull_request) Successful in 15s
2026-09-17 17:26:11 -07:00
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -35,13 +35,13 @@ function toOrderItemDetail(row: {
} }
export async function listOrderSummaries(context: DatabaseContext, query?: string) { export async function listOrderSummaries(context: DatabaseContext, query?: string) {
const search = query?.trim(); const search = query?.trim().toLowerCase();
const filters = search const filters = search
? or( ? or(
sql`instr(lower(${orders.orderNumber}), lower(${search})) > 0`, sql`instr(lower(${orders.orderNumber}), ${search}) > 0`,
sql`instr(lower(${users.name}), lower(${search})) > 0`, sql`instr(lower(${users.name}), ${search}) > 0`,
sql`instr(lower(${users.email}), lower(${search})) > 0` sql`instr(lower(${users.email}), ${search}) > 0`
) )
: undefined; : undefined;
@@ -7,7 +7,7 @@ let app: AppWithContext;
let employeeCookie = ""; let employeeCookie = "";
function firstHeader(value: string | string[] | undefined) { function firstHeader(value: string | string[] | undefined) {
return Array.isArray(value) ? (value[0] ?? "") : value ?? ""; return Array.isArray(value) ? value[0] : value ?? "";
} }
async function login(username: string) { async function login(username: string) {