feat: Improve search functionality by using case-insensitive search for adventure location and name

This commit is contained in:
Sean Morley
2024-06-03 01:50:11 +00:00
parent c91c212fc0
commit 2a5c7c12b1

View File

@@ -84,7 +84,7 @@ export const load: PageServerLoad = async ({ url, locals }) => {
.from(adventureTable) .from(adventureTable)
.where( .where(
and( and(
ilike(adventureTable.location, value), ilike(adventureTable.location, `%${value}%`),
eq(adventureTable.userId, locals.user.id) eq(adventureTable.userId, locals.user.id)
) )
) )
@@ -101,7 +101,7 @@ export const load: PageServerLoad = async ({ url, locals }) => {
.from(adventureTable) .from(adventureTable)
.where( .where(
and( and(
ilike(adventureTable.name, value), ilike(adventureTable.name, `%${value}%`),
eq(adventureTable.userId, locals.user.id) eq(adventureTable.userId, locals.user.id)
) )
) )