From 2a5c7c12b197b1ac6a7eb7a5bfbece78ff8fb1b2 Mon Sep 17 00:00:00 2001 From: Sean Morley Date: Mon, 3 Jun 2024 01:50:11 +0000 Subject: [PATCH] feat: Improve search functionality by using case-insensitive search for adventure location and name --- src/routes/search/+page.server.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/search/+page.server.ts b/src/routes/search/+page.server.ts index 3741b2d..870892b 100644 --- a/src/routes/search/+page.server.ts +++ b/src/routes/search/+page.server.ts @@ -84,7 +84,7 @@ export const load: PageServerLoad = async ({ url, locals }) => { .from(adventureTable) .where( and( - ilike(adventureTable.location, value), + ilike(adventureTable.location, `%${value}%`), eq(adventureTable.userId, locals.user.id) ) ) @@ -101,7 +101,7 @@ export const load: PageServerLoad = async ({ url, locals }) => { .from(adventureTable) .where( and( - ilike(adventureTable.name, value), + ilike(adventureTable.name, `%${value}%`), eq(adventureTable.userId, locals.user.id) ) )