Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
fix pagination
Browse files- src/routes/+page.svelte +2 -0
src/routes/+page.svelte
CHANGED
@@ -42,6 +42,7 @@
|
|
42 |
}
|
43 |
const handleChangeFilter = async (filter: string) => {
|
44 |
form.filter = filter;
|
|
|
45 |
$page.url.searchParams.set('filter', filter);
|
46 |
await goto(`?${$page.url.searchParams.toString()}`);
|
47 |
refetch(false);
|
@@ -50,6 +51,7 @@
|
|
50 |
const handleChangeSearch = async (search: string) => {
|
51 |
clearTimeout(timeout);
|
52 |
form.search = search;
|
|
|
53 |
timeout = setTimeout(async () => {
|
54 |
if (search === "") $page.url.searchParams.delete('search');
|
55 |
else $page.url.searchParams.set('search', search);
|
|
|
42 |
}
|
43 |
const handleChangeFilter = async (filter: string) => {
|
44 |
form.filter = filter;
|
45 |
+
form.page = "0";
|
46 |
$page.url.searchParams.set('filter', filter);
|
47 |
await goto(`?${$page.url.searchParams.toString()}`);
|
48 |
refetch(false);
|
|
|
51 |
const handleChangeSearch = async (search: string) => {
|
52 |
clearTimeout(timeout);
|
53 |
form.search = search;
|
54 |
+
form.page = "0";
|
55 |
timeout = setTimeout(async () => {
|
56 |
if (search === "") $page.url.searchParams.delete('search');
|
57 |
else $page.url.searchParams.set('search', search);
|