Skip to content

Commit

Permalink
feat: make search case-insensitive.
Browse files Browse the repository at this point in the history
  • Loading branch information
zicklag committed Jul 8, 2024
1 parent 396a49d commit cdece0e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/routes/members/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,16 @@
return profiles.filter((x) => {
if (search == '') return true;
for (const word of words) {
const wordLowercase = word.toLowerCase();
for (const field of [
x.bio,
x.username,
printWorkCapacity(x.work_capacity),
printWorkCompensation(x.work_compensation),
...x.tags
]) {
if (word && field && field.includes(word)) {
const fieldLowercase = field?.toLowerCase();
if (wordLowercase && fieldLowercase && fieldLowercase.includes(wordLowercase)) {
return true;
}
}
Expand Down

0 comments on commit cdece0e

Please sign in to comment.