Skip to content

Commit

Permalink
removes minimum length of 2 for searching (some routes may be only 1 …
Browse files Browse the repository at this point in the history
…character long)
  • Loading branch information
aaronbrethorst committed Aug 24, 2024
1 parent 04f409f commit ed0210b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/components/navigation/Header.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@
let searchInput = '';
const debouncedSearch = debounce(async () => {
if (searchInput.length > 2) {
const response = await fetch(`/api/oba/search?query=${encodeURIComponent(searchInput)}`);
const results = await response.json();
dispatch('searchResults', results);
}
const response = await fetch(`/api/oba/search?query=${encodeURIComponent(searchInput)}`);
const results = await response.json();
dispatch('searchResults', results);
}, 300);
$: if (searchInput) debouncedSearch();
Expand Down

0 comments on commit ed0210b

Please sign in to comment.