Skip to content

Commit

Permalink
Don't call search on server
Browse files Browse the repository at this point in the history
  • Loading branch information
allanlasser committed Jan 13, 2025
1 parent f6344a4 commit c23fa05
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/components/documents/Search.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@
import { _ } from "svelte-i18n";
import { page } from "$app/stores";
import { goto } from "$app/navigation";
import { browser } from "$app/environment";
import type { Maybe } from "$lib/api/types";
import Search from "../inputs/Search.svelte";
import Filter, { type FilterFields, defaultFilters } from "./Filter.svelte";
Expand Down Expand Up @@ -255,7 +256,9 @@
// We should call the submit function when the search parameters change
$: {
const search = serialize({ query, filters, sort, direction });
submit(search);
if (browser) {
submit(search);
}
}
// DEBUG LOGGING STRINGS: REMOVE BEFORE MERGE
Expand Down

0 comments on commit c23fa05

Please sign in to comment.