fix: make order search case-insensitive #6
@@ -39,9 +39,9 @@ export async function listOrderSummaries(context: DatabaseContext, query?: strin
|
||||
|
||||
const filters = search
|
||||
? or(
|
||||
sql`instr(${orders.orderNumber}, ${search}) > 0`,
|
||||
sql`instr(${users.name}, ${search}) > 0`,
|
||||
sql`instr(${users.email}, ${search}) > 0`
|
||||
sql`instr(lower(${orders.orderNumber}), lower(${search})) > 0`,
|
||||
|
|
||||
sql`instr(lower(${users.name}), lower(${search})) > 0`,
|
||||
sql`instr(lower(${users.email}), lower(${search})) > 0`
|
||||
)
|
||||
: undefined;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user
Should move the
lower()to thesearchabove, to avoid casting it 3x here.